JP2012027960A - Virtualization program - Google Patents

Virtualization program Download PDF

Info

Publication number
JP2012027960A
JP2012027960A JP2011245409A JP2011245409A JP2012027960A JP 2012027960 A JP2012027960 A JP 2012027960A JP 2011245409 A JP2011245409 A JP 2011245409A JP 2011245409 A JP2011245409 A JP 2011245409A JP 2012027960 A JP2012027960 A JP 2012027960A
Authority
JP
Japan
Prior art keywords
virtual
guest
cpu
vmm
physical
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
JP2011245409A
Other languages
Japanese (ja)
Other versions
JP2012027960A5 (en
JP5369356B2 (en
Inventor
Toshiomi Moriki
俊臣 森木
Naoya Hattori
直也 服部
Yuji Tsushima
雄次 對馬
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 JP2011245409A priority Critical patent/JP5369356B2/en
Publication of JP2012027960A publication Critical patent/JP2012027960A/en
Publication of JP2012027960A5 publication Critical patent/JP2012027960A5/ja
Application granted granted Critical
Publication of JP5369356B2 publication Critical patent/JP5369356B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Stored Programmes (AREA)

Abstract

PROBLEM TO BE SOLVED: To execute a next-generation OS integrated with a virtualization function in a virtual server without deteriorating performance of a virtual computer to integrate the next-generation OS and an existing OS in one physical computer.SOLUTION: One of a guest state area 221 for executing a user program on a second virtual processor and a host state area 222 for executing a guest VMM is selected according to a factor of a call of a host VMM, and a guest state area 131 of a shadow VMCB for controlling a physical processor is updated. Thereby, a next-generation OS having a virtualization function is executed as the user program on a first virtual processor.

Description

本発明は、仮想計算機システムに関し、特に、仮想化支援機能を備えたプロセッサを用いた仮想計算機システムに関する。   The present invention relates to a virtual machine system, and more particularly to a virtual machine system using a processor having a virtualization support function.

近年、オープンサーバの普及に伴い多数のサーバが企業の情報システムに導入された。特に価格性能比が高いiA(Intel Architectures)−32サーバの乱立は、電力やハードウェアの保守費用などを含むサーバの運用管理コストを増大させており、サーバを運用する企業において問題となっている。   In recent years, with the spread of open servers, a large number of servers have been introduced into corporate information systems. In particular, the iA (Intel Architectures) -32 server, which has a high price-performance ratio, has increased server operation and management costs, including power and hardware maintenance costs, and has become a problem for companies that operate servers. .

サーバの運用管理コストを低減するため、複数台のサーバを1台の物理的なサーバ(物理サーバ)に集約するサーバ統合が有望である。サーバ統合の実現方法としては、計算機資源を仮想化する機能を提供する仮想化ソフトウェアが注目されている。仮想化ソフトウェアは1台の物理サーバのCPU(プロセッサ)やI/O等の計算機資源を分割し、複数の仮想的なサーバ(仮想サーバ〉に分割した計算機資源を割付ける制御ソフトウェアである。各仮想サーバ上では各々1つのOS(ゲストOS)が稼動できる。仮想化ソフトウェアを用いると、従来、複数の物理的なサーバで稼動していたOSやアプリケーションを各仮想サーバに割当てて、一つの物理計算機で複数のサーバを提供するサーバ統合を実現することができる。   In order to reduce the operation management cost of servers, server integration that consolidates a plurality of servers into one physical server (physical server) is promising. As a server integration implementation method, virtualization software that provides a function for virtualizing computer resources has attracted attention. The virtualization software is control software that divides computer resources such as CPU (processor) and I / O of one physical server and allocates the divided computer resources to a plurality of virtual servers (virtual servers). Each virtual server can run one OS (Guest OS) When using virtualization software, an OS or application that has conventionally been run on multiple physical servers is assigned to each virtual server, and one physical Server integration that provides a plurality of servers on a computer can be realized.

仮想化ソフトウェアにおける仮想サーバヘの計算機資源の割付方針について説明する。計算機資源のうちCPUの割付について、iA−32向けの仮想化ソフトウェアではVT−x(Virtualization Technology for Xeon)機能(または、AMD−V)等の仮想化支援機能を備えたプロセッサを用いる方法が主流である。VT−xは仮想化ソフトウェアとゲストOSに異なる動作権限を割当てる機能であり、プロセッサのハードウェアに実装されている(例えば、特許文献1または非特許文献1、2)。VT−xに対応したCPUは、ゲストOS間と仮想化ソフトウェアの動作権限の移行を検出してCPUのレジスタ状態の退避や回復を行い、仮想サーバ毎に独立した動作環境を提供する。   A policy for assigning computer resources to virtual servers in virtualization software will be described. Regarding the allocation of CPUs among computer resources, in the virtualization software for iA-32, a method using a processor having a virtualization support function such as VT-x (Virtualization Technology for Xeon) function (or AMD-V) is mainstream. It is. VT-x is a function for assigning different operating authorities to virtualization software and guest OS, and is implemented in the hardware of the processor (for example, Patent Document 1 or Non-Patent Documents 1 and 2). The CPU corresponding to VT-x detects the shift of the operating authority between the guest OSs and the virtualization software, saves and restores the register state of the CPU, and provides an independent operating environment for each virtual server.

一方、I/Oの割付方針は仮想化ソフトウェアによって異なる。仮想化ソフトウェアのI/Oの割り付けは、
(1)物理サーバのI/Oデバイスを直接使用させるI/O直接割付型と、
(2)物理サーバのI/Oデバイスの種類やリビジョンを隠蔽する仮想I/O割付型と、に大別される。
On the other hand, the I / O allocation policy differs depending on the virtualization software. The I / O allocation of virtualization software is
(1) an I / O direct allocation type that directly uses an I / O device of a physical server;
(2) It is roughly classified into a virtual I / O allocation type that conceals the type and revision of an I / O device of a physical server.

上記(1)のI/O直接割付型は、物理サーバで動作済みのI/Oについて、ファイルシステムの再構築等を行うことなく容易にサーバ統合を実現できる長所を有する。一方、上記(2〉の仮想I/O割付型では、物理サーバのI/O種類に依らず一定の1/O構成をゲストOSに提供できる長所を有する。   The I / O direct allocation type (1) has an advantage that server integration can be easily realized without rebuilding a file system or the like for I / O that has already been operated on a physical server. On the other hand, the virtual I / O assignment type (2) has an advantage that a constant 1 / O configuration can be provided to the guest OS regardless of the I / O type of the physical server.

ここで、上述のような仮想化ソフトウェアとしては、次のようなものが知られている。まず、iA−32サーバ向けの仮想化ソフトウェアの1つとして、VMware(登録商標)のESX Serverが知られている。これは、iA−32のCPUを含む物理サーバで、上述したVT−x機能を利用して、既存のOSを複数動作させることが可能である。   Here, the following is known as the virtualization software as described above. First, VMware (registered trademark) ESX Server is known as one of the virtualization software for the iA-32 server. This is a physical server including an iA-32 CPU, and it is possible to operate a plurality of existing OSs using the above-described VT-x function.

汎用機の技術に基づく仮想化ソフトウェアとしては、論理分割運転機能が知られている(IBM System370等)。これは、単一の物理計算機を複数の論理区画(LPAR)に分割し、各LPAR上で既存のOS及び仮想化管理部(VMM=Virtual Machine Manager)を実行する。論理分割運転機能では、汎用機(物理計算機)が上記iA−32のVT−xに相当する機能(LPARモード)を用いて、仮想サーバ(LPAR)上での従来のOSおよびVMMを稼動させている。   As virtualization software based on the technology of general-purpose machines, a logical division operation function is known (IBM System 370 and the like). In this method, a single physical computer is divided into a plurality of logical partitions (LPAR), and an existing OS and a virtualization management unit (VMM = Virtual Machine Manager) are executed on each LPAR. In the logical partitioning operation function, a general-purpose machine (physical computer) operates a conventional OS and VMM on a virtual server (LPAR) by using a function (LPAR mode) corresponding to VT-x of iA-32. Yes.

この他、シミュレータによってiA−32のVT−x機能を提供するものとしてSimOS(http://simos.stanford.edu/introduction.html)等が知られている。この種のシミュレータは、仮想サーバ上のゲストOSの命令列を解釈して任意のサーバおよびCPU機能を提供するソフトウェアである。   In addition, SimOS (http://simos.stanford.edu/introduction.html) and the like are known as those that provide a VT-x function of iA-32 by a simulator. This type of simulator is software that provides an arbitrary server and CPU function by interpreting a command sequence of a guest OS on a virtual server.

さらに、iA−64(IPF=Itanium Processor Family)のプロセッサに実装された仮想化支援機能としては、非特許文献3に記載されるVT−i機能が知られている。   Furthermore, as a virtualization support function implemented in a processor of iA-64 (IPF = Itanium Processor Family), the VT-i function described in Non-Patent Document 3 is known.

特表2005−529401号公報JP 2005-529401A

「Intel 64 and IA-32 Architectures Software Developer’s Manual VOL 2B」、[online]、Intel corp. 発行、[平成19年5月1日検索]、インターネット<URL:http://www.intel.com/design/processor/manuals/253667.pdf>"Intel 64 and IA-32 Architectures Software Developer's Manual VOL 2B", [online], published by Intel corp., [Searched May 1, 2007], Internet <URL: http://www.intel.com/design /processor/manuals/253667.pdf> 「AMD-Virtualization(AMD-V)」、[online]、Advanced Micro Devices, Inc. 発行、[平成19年5月1日検索]、インターネット<URL:http://www.amd.com/jp-ja/assets/content_type/DownloadableAssets/jp-ja_AMD-V_general_200702.pdf>"AMD-Virtualization (AMD-V)", [online], published by Advanced Micro Devices, Inc., [Search May 1, 2007], Internet <URL: http://www.amd.com/jp- en / assets / content_type / DownloadableAssets / jp-ja_AMD-V_general_200702.pdf> 「Intel Itanium Architecture Software Developer's Manual」、[online]、Intel corp. 発行、[平成19年5月1日検索]、インターネット<URL:ftp://download.intel.com/design/Itanium/manuals/24531705.pdf>"Intel Itanium Architecture Software Developer's Manual", [online], published by Intel corp., [Searched May 1, 2007], Internet <URL: ftp://download.intel.com/design/Itanium/manuals/24531705 .pdf>

ところで、近年のサーバ統合の要求から、次世代のサーバOS(Windows(登録商標) Server Longhorn またはWindows(登録商標) Server 2008等)では上述の(2)のような仮想I/O割付型の仮想化ソフトウェアの機能を搭載することが検討されている。   By the way, due to the recent demand for server integration, the next generation server OS (Windows (registered trademark) Server Longhorn or Windows (registered trademark) Server 2008, etc.) has a virtual I / O allocation type virtual as described in (2) above. It is under consideration to install the function of the computerized software.

しかしながら、上記従来の仮想化ソフトウェアでは、次のような問題がある。   However, the conventional virtualization software has the following problems.

上記ESXサーバ等の従来の仮想化ソフトウェアでは、物理計算機を構成するCPUの仮想化支援(VT−x)機能を用いて、複数の仮想サーバ上で既存のOSを稼動させることは可能であるが、仮想サーバに対してVT−x機能を提供することはできない。このため、ESXサーバなどでは次世代のサーバOSのように仮想化ソフトウェア(仮想化機能)を統合したOSを実行することが難しい、という問題がある。   In the conventional virtualization software such as the ESX server, it is possible to operate an existing OS on a plurality of virtual servers by using the virtualization support (VT-x) function of the CPU constituting the physical computer. The VT-x function cannot be provided to the virtual server. For this reason, the ESX server or the like has a problem that it is difficult to execute an OS integrated with virtualization software (virtualization function) like a next-generation server OS.

また、上記論理分割運転機能では、LPAR上のOSやVMMがLPARモードを利用することはできない。このため、仮想化ソフトウェアを統合したOSをLPAR上で稼動させるのは難しい、という問題があった。   In the logical partitioning operation function, the OS or VMM on the LPAR cannot use the LPAR mode. For this reason, there is a problem that it is difficult to run an OS integrated with virtualization software on the LPAR.

さらに、上記シミュレータの場合は、VT−x機能を仮想サーバに対して提供することができ、仮想化ソフトウェアを統合した次世代のOSを稼動させることは可能である。しかしながら、上記シミュレータは、仮想サーバ(ゲストOS)の命令列を解釈し、物理計算機のCPUが実行可能な命令列に変換(バイナリトランスレーション)するためのオーバーヘッドが発生するため、仮想サーバの性能(処理能力)が低下する、という問題があり、複数の仮想サーバを稼働させるサーバ統合を行うことは現実的ではない。   Further, in the case of the simulator, the VT-x function can be provided to the virtual server, and it is possible to operate a next-generation OS integrated with virtualization software. However, the simulator generates overhead for interpreting the instruction sequence of the virtual server (guest OS) and converting it into an instruction sequence executable by the CPU of the physical computer (binary translation). There is a problem that the processing capability is reduced, and it is not realistic to perform server integration for operating a plurality of virtual servers.

また、仮想I/O割り付け型の仮想化機能を統合した次世代OSでは、開発環境の提供など同一のI/O構成の仮想サーバを多数生成する用途には向いているが、既存のサーバで動作済みの従来のOS(VT−x機能を利用しないOS=NTサーバ等)を統合する用途には不向きである。特に、現在、企業が運用するソフトウェア資産は、ほとんどが仮想化機能を含まないOSで稼動するソフトウェアである。このため、今後、サーバ統合を進めていく過程では、仮想化機能を含まない既存のOSと、新たに導入する仮想化機能を含んだ次世代OSが混在するサーバ統合環境が必要となる。しかし、上述のように、従来例では仮想化機能を統合した次世代OSを仮想計算機上に統合することは難しく、また、次世代OSで既存のOSを統合することは難しい、という問題があった。   In addition, the next-generation OS that integrates virtual I / O allocation type virtualization functions is suitable for generating many virtual servers with the same I / O configuration, such as providing a development environment. It is not suitable for use in integrating a conventional operating OS (OS that does not use the VT-x function, such as an NT server). In particular, software assets that are currently operated by companies are mostly software that runs on an OS that does not include a virtualization function. For this reason, in the process of proceeding with server integration in the future, a server integrated environment in which an existing OS that does not include a virtualization function and a next-generation OS that includes a newly introduced virtualization function is required. However, as described above, in the conventional example, it is difficult to integrate a next-generation OS integrated with a virtualization function on a virtual machine, and it is difficult to integrate an existing OS with a next-generation OS. It was.

そこで本発明は、上記問題点に鑑みてなされたもので、仮想計算機の性能を低下させることなく、仮想化機能を統合したOSを仮想サーバで実行可能な仮想計算機を提供することを目的とし、さらに、仮想化機能を統合した次世代のOSと、プロセッサの仮想化支援機能を利用しない従来のOSを一つの物理計算機に統合することを目的とする。   Therefore, the present invention has been made in view of the above problems, and an object thereof is to provide a virtual machine capable of executing an OS integrated with a virtualization function on a virtual server without degrading the performance of the virtual machine. It is another object of the present invention to integrate a next-generation OS that integrates a virtualization function and a conventional OS that does not use a processor virtualization support function into one physical computer.

本発明は、物理プロセッサとメモリを備えた物理計算機で実行されて、複数の仮想プロセッサを提供する仮想化プログラムにおいて、第1の仮想マシンマネージャが第1の仮想プロセッサを生成する手順と、前記第1の仮想プロセッサ上で実行される第2の仮想マシンマネージャが第2の仮想プロセッサを生成する手順と、前記第2の仮想プロセッサがユーザプログラムを実行する手順と、前記第1の仮想マシンマネージャが、前記ユーザプログラムを実行する際の第1の仮想プロセッサの状態を規定する第1の制御情報を前記メモリに設定する手順と、前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャを実行する際の前記第1の仮想プロセッサの状態を規定する第2の制御情報を前記メモリに設定する手順と、前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャまたは前記ユーザプログラムを実行する際の前記物理プロセッサの状態を規定する第3の制御情報を前記メモリに設定する手順と、前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに前記ユーザプログラムの実行を開始させるときには、前記第1の制御情報を参照する手順と、前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに前記第2の仮想マシンマネージャの実行を開始させるときには、前記第2の制御情報を参照する手順と、前記第1の仮想マシンマネージャが、前記参照した前記第1の制御情報または第2の制御情報の一方で前記第3の制御情報を更新する手順と、前記第1の仮想マシンマネージャが、前記物理プロセッサに対して前記第3の制御情報に従って命令の実行を開始するよう指示する第1の制御命令を発行する手順と、を前記物理プロセッサに実行させる。   The present invention is a virtualization program that is executed by a physical computer including a physical processor and a memory and provides a plurality of virtual processors, wherein a first virtual machine manager generates a first virtual processor, A procedure in which a second virtual machine manager executed on one virtual processor generates a second virtual processor, a procedure in which the second virtual processor executes a user program, and the first virtual machine manager A procedure for setting, in the memory, first control information that defines a state of a first virtual processor when the user program is executed, and the first virtual machine manager sets the second virtual machine manager to A procedure for setting, in the memory, second control information that defines a state of the first virtual processor at the time of execution; A step of setting, in the memory, third control information that defines a state of the physical processor when the virtual machine manager executes the second virtual machine manager or the user program, and the first virtual machine When the manager causes the first virtual processor to start the execution of the user program, a procedure for referring to the first control information, and the first virtual machine manager sends the first virtual processor to the first virtual processor. When starting the execution of the second virtual machine manager, the procedure for referring to the second control information, and the first virtual machine manager, one of the first control information or the second control information referred to And updating the third control information with the first virtual machine manager to the physical processor A step of issuing a first control command for instructing to start the execution of instructions in accordance with third control information, is allowed to execute the physical processor.

したがって、本発明は、第2の仮想プロセッサ上のユーザプログラムを実行するための第1の制御情報と、第2の仮想マシンマネージャを実行するための第2の制御情報の何れかを選択し、物理プロセッサを制御するための第3の制御情報を更新することで、第1の仮想プロセッサ上で仮想化機能を備えた次世代OSをユーザプログラムとして実行することが可能となる。また、ユーザプログラムと第2の仮想マシンマネージャの切り換えは、第1または第2の制御情報で第3の制御情報を更新すればよいので、仮想計算機の性能を低下させることなく次世代OSの稼働を実現できる。   Therefore, the present invention selects either of the first control information for executing the user program on the second virtual processor and the second control information for executing the second virtual machine manager, By updating the third control information for controlling the physical processor, it becomes possible to execute a next-generation OS having a virtualization function on the first virtual processor as a user program. In addition, switching between the user program and the second virtual machine manager only has to update the third control information with the first or second control information, so that the operation of the next-generation OS can be performed without degrading the performance of the virtual machine. Can be realized.

そして、第2の仮想マシンマネージャを持たない既存のOSと、第2の仮想マシンマネージャを含む次世代OSを、ひとつの計算機に統合することが可能となる。   Then, an existing OS that does not have the second virtual machine manager and a next-generation OS that includes the second virtual machine manager can be integrated into one computer.

第1の実施形態を示し、本発明を適用する仮想計算機システムのブロック図である。1 is a block diagram of a virtual machine system according to a first embodiment and applying the present invention. FIG. 第1の実施形態を示し、ホストVMMとゲストVMMの機能を示すブロック図である。FIG. 3 is a block diagram illustrating functions of a host VMM and a guest VMM according to the first embodiment. 第1の実施形態を示し、ホストVMM保持データのシャドウVMCBの制御データの一例を示すブロック図である。4 is a block diagram illustrating an example of control data of a shadow VMCB of host VMM holding data according to the first embodiment. FIG. 第1の実施形態を示し、VM−exitの要因リストの一例を示す説明図である。It is explanatory drawing which shows 1st Embodiment and shows an example of the factor list | wrist of VM-exit. 第1の実施形態を示し、ホストVMMで行われる処理の一例を示すフローチャートで、VM−entry命令に起因するVM−exitの処理を示す。FIG. 10 is a flowchart illustrating an example of processing performed by the host VMM according to the first embodiment, and illustrates VM-exit processing caused by a VM-entry instruction. 第1の実施形態を示し、ホストVMMで行われる処理の一例を示すフローチャートで、VMCLEAR命令に起因するVM−exitの処理を示す。FIG. 6 is a flowchart illustrating an example of processing performed by the host VMM according to the first embodiment, and illustrates VM-exit processing caused by a VMCLEAR instruction. 第1の実施形態を示し、ホストVMMで行われる処理の一例を示すフローチャートで、CPUID命令に起因するVM−exitの処理を示す。FIG. 9 is a flowchart illustrating an example of processing performed by the host VMM according to the first embodiment, and illustrates VM-exit processing caused by a CPUID command. 第1の実施形態を示し、ユーザーインターフェースの一例を示す画面イメージである。It is a screen image which shows 1st Embodiment and shows an example of a user interface. 第2の実施形態を示し、物理CPUがAMD−V機能をサポートする場合のホストVMMとゲストVMMの機能を示すブロック図である。FIG. 10 is a block diagram illustrating functions of a host VMM and a guest VMM when a physical CPU supports the AMD-V function according to the second embodiment. 第2の実施形態を示し、ホストVMM保持データのシャドウVMCBの制御データの一例を示すブロック図である。FIG. 9 is a block diagram illustrating an example of control data of a shadow VMCB of host VMM holding data according to the second embodiment. 第2の実施形態を示し、#VMEXITの要因リストの一例を示す説明図である。It is explanatory drawing which shows 2nd Embodiment and shows an example of the factor list | wrist of #VMEXIT. 第2の実施形態を示し、ホストVMMで行われる処理の一例を示すフローチャートで、VMRUN命令に起因する#VMEXITの処理を示す。FIG. 10 is a flowchart illustrating an example of processing performed in the host VMM according to the second embodiment, and illustrates #VMEXIT processing caused by a VMRUN instruction. 第3の実施形態を示し、物理CPUがVT−i機能をサポートする場合のホストVMMとゲストVMMの機能を示すブロック図である。FIG. 10 is a block diagram illustrating functions of a host VMM and a guest VMM when a physical CPU supports a VT-i function according to the third embodiment. 第3の実施形態を示し、ホストVMM保持データのシャドウVPD及び仮想CPU制御データBの制御データの一例を示すブロック図である。FIG. 10 is a block diagram illustrating an example of host VMM holding data shadow VPD and virtual CPU control data B control data according to the third embodiment. 第3の実施形態を示し、仮想化例外の要因リストの一例を示す説明図である。It is explanatory drawing which shows 3rd Embodiment and shows an example of the factor list | wrist of a virtualization exception. 第3の実施形態を示し、ホストVMMで行われる処理の一例を示すフローチャートで、PAL_VPS_RESUMEプロシジャ実行に起因する仮想化例外処理を示す。The flowchart which shows a 3rd embodiment and shows an example of the process performed by host VMM, and shows the virtualization exception process resulting from PAL_VPS_RESUME procedure execution.

以下、本発明の一実施形態を添付図面に基づいて説明する。   Hereinafter, an embodiment of the present invention will be described with reference to the accompanying drawings.

図1は、第1の実施形態を示し、本発明を適用する仮想計算機システムのブロック図である。物理サーバ(物理計算機)101は、仮想化支援機能を備えて演算処理を実行する物理CPU(プロセッサ)104と、データやプログラムを格納するメモリ105と、物理サーバ101の外部の装置とデータの送受信を行うためのI/O装置106と、を含んで構成される。なお、I/O装置106は、ネットワークインターフェースやホストバスアダプタ等で構成される。また、物理CPU104は、複数のCPUで構成しても良いし、複数の演算コアを備えたCPUで構成しても良い。また、物理CPU104の仮想化支援機能(VMX:Virtual Machine Extensions)は、上述のVT−x(Virtualization Technology for IA−32 Processors)またはAMD−V(AMD Virtualization technology)あるいはVT−i(Virtualization Technology for Itanium architecture processors)を含むものである。なお、仮想化支援機能を利用する動作モードをVMXモードとし、仮想化支援機能を利用しない通常の特権レベルによる動作モードは通常動作モードとする。   FIG. 1 is a block diagram of a virtual machine system to which the present invention is applied according to the first embodiment. A physical server (physical computer) 101 has a virtualization support function and executes a physical CPU (processor) 104, a memory 105 for storing data and programs, and data transmission / reception with devices external to the physical server 101. And an I / O device 106 for performing the above. The I / O device 106 includes a network interface and a host bus adapter. The physical CPU 104 may be composed of a plurality of CPUs or a CPU including a plurality of arithmetic cores. Further, the virtualization support function (VMX: Virtual Machine Extensions) of the physical CPU 104 is based on the above-mentioned VT-x (Virtualization Technology for IA-32 Processors), AMD-V (AMD Virtualization Technology), or VT-i (Virtualization Technology for Itanium). architecture processors). Note that an operation mode using the virtualization support function is a VMX mode, and an operation mode based on a normal privilege level not using the virtualization support function is a normal operation mode.

物理サーバ101では、複数の仮想サーバ102a〜102nを稼動させるため、物理サーバ101の物理的な計算機資源を仮想化した計算機資源に変換し、各仮想サーバ102a〜102nへ仮想計算機資源を割り当てるホストVMM(仮想マシンマネージャ:Virtual Machine Manager)10が実行される。このホストVMMは、メモリ105に読み込まれて物理CPU104で実行されるプログラムとして提供される。ホストVMM10は、各仮想サーバ102a〜102nに対して、仮想CPU108a〜108nを提供し、また、メモリ105とI/O装置106を各仮想サーバ102a〜102nに割り当てる。なお、各仮想サーバ102a〜102nに、物理サーバ101の計算機資源を割り当てる手法については、周知または公知のものを適宜用いればよいので、ここでは詳述しない。   In the physical server 101, in order to operate a plurality of virtual servers 102a to 102n, the host VMM that converts the physical computer resources of the physical server 101 into virtualized computer resources and allocates the virtual computer resources to the virtual servers 102a to 102n. (Virtual Machine Manager) 10 is executed. The host VMM is provided as a program that is read into the memory 105 and executed by the physical CPU 104. The host VMM 10 provides virtual CPUs 108a to 108n to the virtual servers 102a to 102n, and allocates the memory 105 and the I / O device 106 to the virtual servers 102a to 102n. Note that, as a method of assigning the computer resources of the physical server 101 to the virtual servers 102a to 102n, any known or publicly known method may be used as appropriate, and therefore will not be described in detail here.

物理サーバ101は、ユーザーインターフェース301を提供する管理コンソール300に接続され、管理者などが計算機資源の割り当てなどの設定をユーザーインターフェース301を介してホストVMM10へ入力する。また、ユーザーインターフェース301は、ホストVMM10から受信した設定状態等を管理コンソール300の表示装置へ出力する。   The physical server 101 is connected to a management console 300 that provides a user interface 301, and an administrator or the like inputs settings such as computer resource assignment to the host VMM 10 via the user interface 301. In addition, the user interface 301 outputs the setting state received from the host VMM 10 to the display device of the management console 300.

物理サーバ101のホストVMM10上で稼動する仮想サーバ102a〜102nは、ユーザプログラム110a〜110nとして、ゲストOS111a〜111nがそれぞれ稼動し、各ゲストOS111a〜111n上ではアプリケーション112a〜112nが実行されている。各ゲストOS111a〜111nは、ホストVMM10が提供する仮想CPU108a〜108nで実行される。なお、仮想CPU108a〜108nは、一つの仮想サーバに対して複数の仮想CPUを割り当てるようにすることができる。   In the virtual servers 102a to 102n operating on the host VMM 10 of the physical server 101, guest OSs 111a to 111n operate as user programs 110a to 110n, and applications 112a to 112n are executed on the guest OSs 111a to 111n. Each of the guest OSs 111a to 111n is executed by virtual CPUs 108a to 108n provided by the host VMM 10. The virtual CPUs 108a to 108n can allocate a plurality of virtual CPUs to one virtual server.

そして、仮想サーバ102aでは、ゲストOS111aとして仮想化機能(ゲストVMM20)を統合した次世代OSが実行され、仮想サーバ102nでは、ゲストOS111nとして仮想化機能を利用しない既存のOS(例えば、NTサーバ)が実行される。   In the virtual server 102a, a next-generation OS that integrates a virtualization function (guest VMM 20) is executed as the guest OS 111a. In the virtual server 102n, an existing OS that does not use the virtualization function as the guest OS 111n (for example, an NT server). Is executed.

ホストVMM10は、既存のOSを実行する仮想サーバ102nに対しては、仮想CPU108nと、管理コンソール300から設定された計算機資源を割り当て、既存のゲストOS111nと、アプリケーション112nを実行する。   The host VMM 10 allocates the virtual CPU 108n and computer resources set from the management console 300 to the virtual server 102n that executes the existing OS, and executes the existing guest OS 111n and the application 112n.

一方、ホストVMM10は、次世代OSを実行する仮想サーバ102aへ割り当てる仮想CPU108aに、仮想化支援機能を提供する。仮想CPU108a上ではゲストVMM(第2仮想マシンマネージャ)20が稼働し、このゲストVMM20は仮想CPU208a〜208iを提供する。次世代OSが稼働する仮想サーバ102aでは、第1の仮想CPU108a上で第2の仮想CPU208a〜208iが複数提供され、各仮想CPU208a〜208iでは、複数のユーザプログラム110a(ゲストOS111a及びアプリケーション112a)〜110i(ゲストOS111i及びアプリケーション112i)が実行される。   On the other hand, the host VMM 10 provides a virtualization support function to the virtual CPU 108a assigned to the virtual server 102a that executes the next-generation OS. A guest VMM (second virtual machine manager) 20 runs on the virtual CPU 108a, and the guest VMM 20 provides virtual CPUs 208a to 208i. In the virtual server 102a on which the next-generation OS runs, a plurality of second virtual CPUs 208a to 208i are provided on the first virtual CPU 108a, and each of the virtual CPUs 208a to 208i has a plurality of user programs 110a (guest OS 111a and application 112a) to 110i (guest OS 111i and application 112i) is executed.

以下、本第1実施形態では、物理CPU104にVT−x機能を備え、仮想サーバ102aのゲストOS111aが仮想化機能を統合した次世代OSの例について説明する。   Hereinafter, in the first embodiment, an example of a next-generation OS in which the physical CPU 104 has the VT-x function and the guest OS 111a of the virtual server 102a integrates the virtualization function will be described.

VT−x機能を利用するホストVMM10は、メモリ105の所定の領域に仮想サーバ102a〜102nの状態と物理CPU104を制御するための制御情報を格納するホストVMM保持データ11を格納する。そして、ホストVMM保持データ11には、物理CPU104を制御するための物理CPU制御データ13が格納される。物理CPU制御データ13は、仮想化支援機能を利用する仮想CPU108a〜108nのステータスを示すデータ構造で、VMCB(Virtual Machine Control Block)またはVMCS(Virtual Machine Control Structure)という。なお、本実施形態では、ホストVMM保持データ11内の物理CPU制御データ13を、図2で示すようにシャドウVMCB#0〜#nとし、ゲストVMM20が操作する仮想CPU制御データ21をゲストVMCBとして区別する。また、物理CPU104は、物理CPU制御データ13のシャドウVMCB#0〜#nを参照するためのポインタ115を備える。   The host VMM 10 that uses the VT-x function stores the host VMM holding data 11 that stores the state of the virtual servers 102 a to 102 n and control information for controlling the physical CPU 104 in a predetermined area of the memory 105. The host VMM holding data 11 stores physical CPU control data 13 for controlling the physical CPU 104. The physical CPU control data 13 is a data structure indicating the status of the virtual CPUs 108a to 108n using the virtualization support function, and is called a VMCB (Virtual Machine Control Block) or VMCS (Virtual Machine Control Structure). In this embodiment, the physical CPU control data 13 in the host VMM holding data 11 is the shadow VMCB # 0 to #n as shown in FIG. 2, and the virtual CPU control data 21 operated by the guest VMM 20 is the guest VMCB. Distinguish. The physical CPU 104 also includes a pointer 115 for referring to the shadow VMCBs # 0 to #n of the physical CPU control data 13.

ホストVMM10は、物理CPU制御データ13内のシャドウVMCB#0〜#nを書き換えることで、物理CPU104の動作モードを、ユーザプログラム110aまたはゲストVMM20を実行する動作モード(VMXノンルートモード)と、ホストVMM10を実行する動作モード(VMXルートモード)の何れかに設定する。   The host VMM 10 rewrites the shadow VMCBs # 0 to #n in the physical CPU control data 13, thereby changing the operation mode of the physical CPU 104 to the operation mode (VMX non-root mode) for executing the user program 110a or the guest VMM 20, and the host The operation mode (VMX root mode) for executing the VMM 10 is set.

仮想サーバ102aでは、ホストVMM10が提供する仮想CPU108a上で、次世代OSであるゲストOS111aに統合された仮想化機能(仮想化ソフトウェア)が、ゲストVMM20として稼動する。ゲストVMM20には、仮想CPU108aの仮想化支援機能を制御するためのVMCB(ゲストVMCB22)を含む仮想CPU制御データ21が格納される。ゲストVMCB22は、ホストVMM10によって割り当てられたメモリ105上の所定の領域に格納される。   In the virtual server 102a, on the virtual CPU 108a provided by the host VMM 10, a virtualization function (virtualization software) integrated with the guest OS 111a, which is the next generation OS, operates as the guest VMM 20. The guest VMM 20 stores virtual CPU control data 21 including a VMCB (guest VMCB 22) for controlling the virtualization support function of the virtual CPU 108a. The guest VMCB 22 is stored in a predetermined area on the memory 105 allocated by the host VMM 10.

また、仮想CPU108aは、ゲストVMM20の仮想CPU制御データ21(ゲストVMCB22)を参照するためのポインタ116を備える。このポインタ116は、VT−x機能に対応するゲストOS111aが保持する仮想CPU108aの制御データ構造(ゲストVMCB22)へのポインタであり、ゲストOS111aからのVMPTRLD命令発行時に初期化される。なお、ポインタ116の初期化は、ゲストVMM20が実行する。   In addition, the virtual CPU 108 a includes a pointer 116 for referring to the virtual CPU control data 21 (guest VMCB 22) of the guest VMM 20. This pointer 116 is a pointer to the control data structure (guest VMCB 22) of the virtual CPU 108a held by the guest OS 111a corresponding to the VT-x function, and is initialized when a VMPTRLD instruction is issued from the guest OS 111a. The guest VMM 20 executes the initialization of the pointer 116.

図1において、次世代OSが稼動する仮想サーバ102aの仮想CPU208a〜208iは、次世代OSに統合されたゲストVMM20が提供するものであり、各仮想CPU208a〜208i上でユーザプログラム110a〜110iを実行することができる。なお、仮想サーバ102aのゲストVMM20は、ゲストOS111aのアドインソフトウェアとして機能するものであっても良い。   In FIG. 1, the virtual CPUs 208a to 208i of the virtual server 102a on which the next-generation OS runs are provided by the guest VMM 20 integrated with the next-generation OS, and the user programs 110a to 110i are executed on the virtual CPUs 208a to 208i. can do. Note that the guest VMM 20 of the virtual server 102a may function as add-in software for the guest OS 111a.

<本発明の概要>
仮想化を支援するVT−x機能では、ホストVMM10が物理サーバ101のメモリ105上に確保するシャドウVMCBを用いて、物理CPU104の動作モードを制御する。仮想化支援機能としてVT−x機能を備えた物理CPU104は、通常の動作モードと仮想化支援機能を提供するVMX(Virtual Machine Extensions)モードを備え、VMXモードでは、ホストVMM10が動作するホストモード(以下、VMXルートモード)と、ゲストVMM20またはユーザプログラム(ゲストOS111aまたはアプリケーション112a)が動作するゲストモード(以下、VMXノンルートモード)の何れかに切り替える。
<Outline of the present invention>
In the VT-x function that supports virtualization, the host VMM 10 controls the operation mode of the physical CPU 104 using the shadow VMCB secured on the memory 105 of the physical server 101. The physical CPU 104 having a VT-x function as a virtualization support function has a normal operation mode and a VMX (Virtual Machine Extensions) mode that provides a virtualization support function. In the VMX mode, a host mode (where the host VMM 10 operates) ( Hereinafter, the mode is switched to either the VMX root mode) or the guest mode in which the guest VMM 20 or the user program (guest OS 111a or application 112a) operates (hereinafter, VMX non-root mode).

物理CPU制御データ13のシャドウVMCB中には仮想サーバ102a上のユーザプログラム110aの動作状態を規定するフィールド(ゲスト状態エリア131)が1種類しかなく、単純には次世代OSの仮想化機能であるゲストVMM20と、ユーザプログラム110a(ゲストOS111aまたはアプリケーション112a)を区分できない。   The shadow VMCB of the physical CPU control data 13 has only one type of field (guest state area 131) that defines the operation state of the user program 110a on the virtual server 102a, which is simply a virtualization function of the next generation OS. The guest VMM 20 and the user program 110a (guest OS 111a or application 112a) cannot be distinguished.

そこで、本発明では、1つの仮想CPUが、ゲストVMM20とユーザプログラム110aを同時に実行することがないことに着目し、ホストVMM10が仮想化機能を統合したゲストOS111aを実行する仮想サーバ102aのゲストVMM20と、ユーザプログラム110aの実行の切替を監視して、動作モードの切替時にホストVMM保持データ11のシャドウVMCB#0〜#n内のゲスト状態エリア131を書き換えることにより、仮想サーバ102a上で仮想化機能を稼動させるものである。   Therefore, in the present invention, focusing on the fact that one virtual CPU does not execute the guest VMM 20 and the user program 110a at the same time, the guest VMM 20 of the virtual server 102a that executes the guest OS 111a in which the host VMM 10 integrates the virtualization function. And monitoring the switching of execution of the user program 110a, and rewriting the guest state area 131 in the shadow VMCBs # 0 to #n of the host VMM holding data 11 at the time of switching the operation mode, thereby virtualizing on the virtual server 102a. The function is activated.

このため、ホストVMM10は、仮想化機能を統合した次世代OSであるゲストOS111aを監視して、物理CPU104の動作モードを、ホストVMM10が動作するVMXルートモードと、ゲストVMM20またはユーザプログラム110aが動作するVMXノンルートモードモードに切り替え、所定の条件(VM−exit)でVMXルートモードではホストVMM10がゲストVMM20やゲストOSの命令をエミュレートする。これにより、ゲストOS111aに対して、仮想CPU108aが仮想化支援機能を提供するように見せかける。   Therefore, the host VMM 10 monitors the guest OS 111a, which is the next generation OS that integrates the virtualization function, and changes the operation mode of the physical CPU 104, the VMX root mode in which the host VMM 10 operates, and the guest VMM 20 or the user program 110a. The VMM non-root mode is switched to the VMX non-root mode, and the host VMM 10 emulates the commands of the guest VMM 20 and the guest OS in the VMX root mode under a predetermined condition (VM-exit). This makes it appear to the guest OS 111a that the virtual CPU 108a provides a virtualization support function.

<ホストVMMの構成>
ホストVMM10は、上述のホストVMM保持データ11の他に、仮想サーバ102a〜102nを監視して、物理CPU104の動作モードをVMXルートモードとVMXノンルートモードの何れかに切り替えるCPU制御部12を備える。
<Configuration of host VMM>
In addition to the host VMM holding data 11 described above, the host VMM 10 includes a CPU control unit 12 that monitors the virtual servers 102a to 102n and switches the operation mode of the physical CPU 104 to either the VMX root mode or the VMX non-root mode. .

さらに、ホストVMM10は、CPU制御部12が仮想サーバ102a〜102nの状態を取得し、各仮想サーバ102a〜102nへ指令を送信するためのインターフェースである制御・通信インターフェース14と、CPU制御部12が物理CPU104へ命令を発行するための命令発行インターフェース15と、物理CPU104が物理CPU制御データ13を参照または更新するための参照・更新インターフェース16と、I/O装置106からの割り込み要求などを受け付けて、この要求に応答するためのI/O要求・応答インターフェース17を備える。   Further, the host VMM 10 includes a control / communication interface 14 that is an interface for the CPU control unit 12 to acquire the status of the virtual servers 102a to 102n and transmit commands to the virtual servers 102a to 102n, and the CPU control unit 12 An instruction issue interface 15 for issuing instructions to the physical CPU 104, a reference / update interface 16 for the physical CPU 104 to reference or update the physical CPU control data 13, an interrupt request from the I / O device 106, etc. And an I / O request / response interface 17 for responding to the request.

図2は、ホストVMM10とゲストVMM20の機能を示すブロック図である。ホストVMM10は、物理CPU104の仮想化支援機能(VT−x機能)を利用するため、メモリ105の所定の領域にホストVMM保持データ11を設定する。   FIG. 2 is a block diagram illustrating functions of the host VMM 10 and the guest VMM 20. The host VMM 10 sets the host VMM holding data 11 in a predetermined area of the memory 105 in order to use the virtualization support function (VT-x function) of the physical CPU 104.

ホストVMM保持データ11は、ゲストOS111a〜111nの仮想化支援機能の利用の有無や、仮想CPU108a〜108nの状態を示すフラグ類を格納する領域と、仮想CPU108a〜108n毎のステータス等を格納するシャドウVMCB#0〜#nを保持する物理CPU制御データ13の領域を含んで構成される。   The host VMM holding data 11 is a shadow that stores an area for storing presence / absence of use of the virtualization support function of the guest OSs 111a to 111n, a flag indicating the status of the virtual CPUs 108a to 108n, a status for each of the virtual CPUs 108a to 108n, and the like. It includes a physical CPU control data 13 area that holds VMCBs # 0 to #n.

ホストVMM保持データ11のゲストOSや仮想CPUの状態を示すフラグとしては、例えば、ゲストOS111a〜111n毎に物理CPU104の仮想化支援機能を利用可能か否かを識別する仮想化機能有効フラグ141と、仮想CPU108a〜108n毎に仮想化支援機能を利用中か否かを設定するVMXONフラグ142と、仮想CPU108a〜108n仮想化支援機能がVMXルートモードまたはVMXノンルートモードの何れで動作しているのかを示す動作モードフラグ143が挙げられる。   As a flag indicating the state of the guest OS or virtual CPU of the host VMM holding data 11, for example, a virtualization function valid flag 141 for identifying whether the virtualization support function of the physical CPU 104 can be used for each of the guest OSs 111a to 111n The VMXON flag 142 for setting whether or not the virtualization support function is being used for each virtual CPU 108a to 108n, and whether the virtual CPU 108a to 108n virtualization support function is operating in the VMX root mode or the VMX non-root mode The operation mode flag 143 indicating

仮想化機能有効フラグ141は、ゲストOS111a〜111n毎に設定されて「1」であれば該当するゲストOSが仮想化支援機能を利用可能であることを示し、「0」であればゲストOSが仮想化支援機能を利用しないことを示す。この仮想化機能有効フラグ141は、ゲストOS111a〜111n毎に管理コンソール300から設定したり、あるいは、予め設定したファイルなどから設定する。   If the virtualization function valid flag 141 is set for each of the guest OSs 111a to 111n and is “1”, it indicates that the corresponding guest OS can use the virtualization support function. Indicates that the virtualization support function is not used. The virtualization function enable flag 141 is set from the management console 300 for each of the guest OSs 111a to 111n, or set from a preset file or the like.

VMXONフラグ142は、各仮想CPU108a〜108n毎にVMXモードの動作状態を示すフラグで、「1」のときには該当する仮想CPU108a〜108nの動作モードがVMXモードであることを示し、「0」のときには該当する仮想CPU108a〜108nの動作モードが仮想化支援機能を利用しない通常動作モードであることを示す。VMXONフラグ142は、ゲストOS111a〜111nがVMXON命令を発行したときにホストVMM10が「1」をセットし、ゲストOS111a〜111nがVMXOFF命令を発行したときにホストVMM10が「0」にリセットする。   The VMXON flag 142 is a flag indicating the operation state of the VMX mode for each of the virtual CPUs 108a to 108n. When it is “1”, it indicates that the operation mode of the corresponding virtual CPU 108a to 108n is the VMX mode, and when it is “0”. This indicates that the operation mode of the corresponding virtual CPU 108a to 108n is a normal operation mode that does not use the virtualization support function. The VMXON flag 142 is set to “1” by the host VMM 10 when the guest OSs 111 a to 111 n issue the VMXON command, and is reset to “0” when the guest OSs 111 a to 111 n issue the VMXOFF command.

動作モードフラグ143は、仮想CPU108a〜108n上で動作するプログラムの動作モードを追跡するフラグである。この動作モードフラグ143は、ゲストOS111a〜111nのVM−entry時にホストVMM10が「1」にセットし、ゲストOSのVM−exit時にホストVMM10が「0」にリセットする。つまり、この動作モードフラグ143は、VMXONフラグ142が「1」のときに各仮想CPU108a〜108n毎のVMXモードの種別を示すもので、動作モードフラグ143が「0」のときには仮想CPU108a〜108nがゲストVMM20を実行する状態(仮想CPUのVMXルートモード)を示し、動作モードフラグ143が「1」のときには仮想CPUがユーザプログラム110a(ゲストOS111aまたはアプリケーション112a)を実行する状態(仮想CPUのVMXノンルートモード)を示す。   The operation mode flag 143 is a flag for tracking the operation mode of a program operating on the virtual CPUs 108a to 108n. The operation mode flag 143 is set to “1” by the host VMM 10 when the guest OSs 111 a to 111 n are VM-entry, and the host VMM 10 is reset to “0” when the guest OS is VM-exit. That is, this operation mode flag 143 indicates the type of VMX mode for each virtual CPU 108a to 108n when the VMXON flag 142 is "1", and when the operation mode flag 143 is "0", the virtual CPUs 108a to 108n Indicates the state in which the guest VMM 20 is executed (VMX root mode of the virtual CPU), and when the operation mode flag 143 is “1”, the virtual CPU executes the user program 110a (guest OS 111a or application 112a) (VMX non-virtual CPU) Root mode).

ここで、VMXモードのVMXルートモードとVMXノンルートモードの遷移については、上記非特許文献1に記載されるとおりである。ここでは、概要のみについて説明する。通常動作モードからVMXモードへ移行する際には、ホストVMM10がVMXON命令を発行し、物理CPU104の動作モードをVMXモードに移行させる。そして、VMXモードへ移行したホストVMM10は、該当する仮想CPU108a〜108nのシャドウVMCB#0〜#n−1にユーザプログラム110aを実行させるための情報を書き込んでからVM−entry命令(VMLAUNCH命令またはVMRESUME命令)を発行し、VMXルートモードからVMXノンルートモードへ移行する。このVMXルートモードからVMXノンルートモードへの遷移をVM−entryという。   Here, transition between the VMX root mode and the VMX non-root mode in the VMX mode is as described in Non-Patent Document 1 above. Here, only the outline will be described. When shifting from the normal operation mode to the VMX mode, the host VMM 10 issues a VMXON instruction to shift the operation mode of the physical CPU 104 to the VMX mode. Then, the host VMM 10 that has shifted to the VMX mode writes information for causing the shadow VMCBs # 0 to # n-1 of the corresponding virtual CPUs 108a to 108n to execute the user program 110a, and then executes a VM-entry instruction (a VMLAUNCH instruction or a VMRESUME instruction). Command) to shift from the VMX root mode to the VMX non-root mode. This transition from the VMX root mode to the VMX non-root mode is called VM-entry.

逆に、VMXノンルートモードからVMXルートモードへの遷移は、VM−exitという。このVM−exitは、ゲストOS111a〜111nが特権命令を発行したときなどの所定の要因で物理CPU104がホストVMM10へVM−exitを通知する。ホストVMM10のCPU制御部12がVM−exitを検知すると、所定のエミュレーションを行ってゲストVMM20またはゲストOSの処理を完了した後、シャドウVMCBを必要に応じて書き換えてからVM−entry命令(第1制御命令)を発行してVMXノンルートモードからVMXルートモードへ切り替える。   Conversely, the transition from the VMX non-root mode to the VMX root mode is referred to as VM-exit. In the VM-exit, the physical CPU 104 notifies the host VMM 10 of the VM-exit due to a predetermined factor such as when the guest OSs 111a to 111n issue privileged instructions. When the CPU control unit 12 of the host VMM 10 detects the VM-exit, after performing the predetermined emulation and completing the processing of the guest VMM 20 or the guest OS, the shadow VMCB is rewritten as necessary, and then the VM-entry instruction (first Control command) to switch from the VMX non-root mode to the VMX root mode.

本発明では、次世代OSであるゲストOS111aのVM−entryの際に、ホストVMM10がゲストVMCB22のゲスト状態エリア221とホスト状態エリア222を読み込んで、ゲストOS111aの動作に応じた一方のエリアの内容をシャドウVMCB#0のゲスト状態エリア131へ設定することで、仮想サーバ102aでゲストOS111aの仮想化機能を実現するのである。   In the present invention, during VM-entry of the guest OS 111a, which is the next generation OS, the host VMM 10 reads the guest status area 221 and the host status area 222 of the guest VMCB 22, and the contents of one area according to the operation of the guest OS 111a Is set in the guest status area 131 of the shadow VMCB # 0, the virtual server 102a implements the virtualization function of the guest OS 111a.

VT−x機能では以上のような、VM−entryとVM−exitの遷移により、ホストVMM10とゲストVMM20またはユーザプログラム110aを切り替える。このため、VM−entryとVM−exitの前後の物理CPU104のステータス等を保持するために、物理CPU制御データ13のデータ構造であるシャドウVMCB#0〜#nを使用する。   In the VT-x function, the host VMM 10 and the guest VMM 20 or the user program 110a are switched by the transition between the VM-entry and the VM-exit as described above. For this reason, in order to hold the status of the physical CPU 104 before and after the VM-entry and the VM-exit, the shadow VMCBs # 0 to #n that are the data structure of the physical CPU control data 13 are used.

物理CPU制御データ13は、仮想CPU108a〜108n毎にシャドウVMCB#0〜#nが設定され、各シャドウVMCBには次のようなデータが格納される。   In the physical CPU control data 13, shadow VMCBs # 0 to #n are set for the virtual CPUs 108a to 108n, and the following data is stored in each shadow VMCB.

ゲスト状態エリア131には、図3で示すように、仮想CPU108a〜108nのレジスタ状態などのステータスが格納される。すなわち、後述するように、ゲストVMM20のステータスまたはユーザプログラム110aのステータスが選択的に格納される。   In the guest state area 131, as shown in FIG. 3, statuses such as register states of the virtual CPUs 108a to 108n are stored. That is, as will be described later, the status of the guest VMM 20 or the status of the user program 110a is selectively stored.

ホスト状態エリア132には、図3で示すように、ホストVMM10の物理CPU104のレジスタ状態などのステータスが格納される。VM実行制御領域133には、仮想サーバ102a〜102nの設定情報が格納され、例えば、例外ビットマップやI/Oビットマップなどの情報が含まれる。VM−exit制御領域134には、VM−exitの要因などの情報が格納される。VM−entry制御領域135には、VM−entryの動作を制御するための情報が格納される。そして、VM−exit情報領域136には、VM−exitを発生する要因(命令またはイベント)を格納する。VM−exitを発生させる要因としては、例えば、図4に示す「description」に示すものがVM−exit情報領域136に設定される。   As shown in FIG. 3, the host status area 132 stores status such as the register status of the physical CPU 104 of the host VMM 10. The VM execution control area 133 stores setting information of the virtual servers 102a to 102n, and includes information such as an exception bitmap and an I / O bitmap. The VM-exit control area 134 stores information such as the VM-exit factor. The VM-entry control area 135 stores information for controlling the operation of the VM-entry. The VM-exit information area 136 stores a factor (command or event) that causes the VM-exit. As a factor for generating the VM-exit, for example, the one shown in “description” shown in FIG. 4 is set in the VM-exit information area 136.

以上のようなシャドウVMCB#0〜#nにより、ホストVMM10は各仮想サーバ102a〜102nの制御を行う。   With the shadow VMCBs # 0 to #n as described above, the host VMM 10 controls the virtual servers 102a to 102n.

一方、仮想サーバ102aのゲストVMM20が管理する仮想CPU制御データ21には、上記物理CPU制御データ13のシャドウVMCB#0と同様のデータ構造であるゲストVMCB22が格納される。   On the other hand, in the virtual CPU control data 21 managed by the guest VMM 20 of the virtual server 102a, the guest VMCB 22 having the same data structure as the shadow VMCB # 0 of the physical CPU control data 13 is stored.

ゲストVMM20は、ユーザプログラム110a(ゲストOS111aまたはアプリケーション112a)を実行する仮想CPU108aのレジスタ状態などのステータス等を格納するゲスト状態エリア221と、ゲストVMM20を実行する仮想CPU108aのレジスタ状態などのステータスを格納するホスト状態エリア222と、仮想サーバ102aの設定情報を格納するVM実行制御領域223と、仮想サーバ102aにおけるVM−exitの要因などの情報を格納するVM−exit制御領域224と、仮想サーバ102aにおけるVM−entryの動作を制御するための情報を格納するVM−entry制御領域225と、仮想サーバ102aにおけるVM−exitの原因を特定する情報を格納するVM−exit情報領域226とを備える。   The guest VMM 20 stores a guest state area 221 for storing the status and the like of the register state of the virtual CPU 108a that executes the user program 110a (guest OS 111a or application 112a), and a status of the register state and the like of the virtual CPU 108a that executes the guest VMM 20 Host status area 222, a VM execution control area 223 for storing setting information of the virtual server 102a, a VM-exit control area 224 for storing information such as a VM-exit factor in the virtual server 102a, and a virtual server 102a A VM-entry control area 225 for storing information for controlling the operation of the VM-entry, and a VM-exit information area for storing information for specifying the cause of the VM-exit in the virtual server 102a And a 226.

ゲスト状態エリア221には、上記図3と同様に、仮想CPU108aのレジスタ状態などのステータスが格納される。すなわち、後述するように、ゲストOS111aのステータスまたはアプリケーション112aのステータスが選択的に格納される。   The guest status area 221 stores the status such as the register status of the virtual CPU 108a as in FIG. That is, as will be described later, the status of the guest OS 111a or the status of the application 112a is selectively stored.

仮想サーバ102aの状態を制御するホストVMM10のシャドウVMCB#0では、ゲスト状態エリア131にゲストVMM20のステータスまたはユーザプログラム110a(ゲストOS111aまたはアプリケーション112a)のステータスが格納され、ホスト状態エリア132にはホストVMM10のステータスが格納される。   In the shadow VMCB # 0 of the host VMM 10 that controls the state of the virtual server 102a, the status of the guest VMM 20 or the status of the user program 110a (guest OS 111a or application 112a) is stored in the guest status area 131, and the host status area 132 stores the host The status of the VMM 10 is stored.

一方、ゲストVMM20のゲストVMCB22では、ゲスト状態エリア221にゲストOS111aのステータスまたはアプリケーション112aのステータスが格納され、ホスト状態エリア222にはゲストVMM20のステータスが格納される点でシャドウVMCB#0と相違する。   On the other hand, the guest VMCB 22 of the guest VMM 20 is different from the shadow VMCB # 0 in that the status of the guest OS 111a or the status of the application 112a is stored in the guest state area 221 and the status of the guest VMM 20 is stored in the host state area 222. .

次に、ホストVMM10のCPU制御部12の構成について説明する。CPU制御部12は、管理コンソール300からの入力などに基づいて各仮想サーバ102a〜102nへ物理サーバ101の計算機資源を割り当てるリソース管理部(図示省略)に加えて、ゲストOS111aの仮想化機能(ゲストVMM20)を稼動させるため、仮想CPUのステータスの読み込み先を選択する状態エリア選択部121と、エミュレータ122と、シャドウVMCB参照・更新部123と、VM−exitハンドラ124と、VM−entry命令発行部125と、ユーザーインターフェース301とを備える。なお、リソース管理部については、上述のように公知または周知の技術を適用すればよいので、本実施形態では詳述しない。   Next, the configuration of the CPU control unit 12 of the host VMM 10 will be described. In addition to a resource management unit (not shown) that allocates the computer resources of the physical server 101 to each of the virtual servers 102a to 102n based on input from the management console 300, the CPU control unit 12 has a virtualization function (guest) The VMM 20) to operate, a state area selection unit 121 that selects a reading destination of the status of the virtual CPU, an emulator 122, a shadow VMCB reference / update unit 123, a VM-exit handler 124, and a VM-entry instruction issue unit 125 and a user interface 301. Note that the resource management unit is not described in detail in the present embodiment because a known or well-known technique may be applied as described above.

VM−exitハンドラ124は、物理CPU104からVM−exitを受信して、エミュレータ122を起動する。   The VM-exit handler 124 receives the VM-exit from the physical CPU 104 and activates the emulator 122.

エミュレータ122は、VM−exitハンドラ124から受信したVM−exitの発生要因となった命令またはイベントを特定し、後述するように特定した発生要因に対応するモジュールを起動してゲストVMM20やユーザプログラム110aに代わって処理を実行する。   The emulator 122 identifies the instruction or event that has caused the occurrence of the VM-exit received from the VM-exit handler 124, and activates the module corresponding to the identified occurrence factor as will be described later, so that the guest VMM 20 and the user program 110a are activated. Process on behalf of

エミュレータ122が、仮想CPU108aの動作モードの変更(VMXルートとVMXノンルートの切り替え)を検出した場合は、特定した要因に応じたモジュール(VM−entry命令実行モジュール、VMCLEAR命令実行モジュール、CPUID命令実行モジュール、VM−exit条件検出モジュール)を起動して、状態エリア選択部121を起動する。   When the emulator 122 detects a change in the operation mode of the virtual CPU 108a (switching between the VMX root and the VMX non-root), modules according to the specified factors (VM-entry instruction execution module, VMCLEAR instruction execution module, CPUID instruction execution module) , The VM-exit condition detection module) is activated, and the state area selection unit 121 is activated.

ここで、VM−exitの発生要因は、図4に示すように、シャドウVMCB#0のVM−exit情報領域136の「Exit reason」に設定されたものである。図4に示すVM−exitの要因リストには、VM−entry命令の発行に起因する要因1361と、VMCLEAR命令(第4制御命令)の発行に起因する要因1362と、ゲストVMM20へのVM−exit通知の有無を設定した通知条件1363が予め設定される。   Here, the generation factor of the VM-exit is set to “Exit reason” in the VM-exit information area 136 of the shadow VMCB # 0 as shown in FIG. The VM-exit factor list shown in FIG. 4 includes a factor 1361 caused by the issuance of the VM-entry instruction, a factor 1362 caused by the issuance of the VMCLEAR instruction (fourth control instruction), and the VM-exit to the guest VMM 20 A notification condition 1363 for setting the presence / absence of notification is set in advance.

例えば、仮想CPU108aの動作モードを切り替える際のVM−exitの要因として、VM−entry命令(VMLAUNCH命令またはVMRESUME命令)を検出した場合には、図4の要因1361に該当するので、ホストVMM10はVM−entry命令実行モジュールでエミュレーションを行い、ゲストVMM20またユーザプログラム110aに代わって処理を行う。   For example, if a VM-entry instruction (VMLAUNCH instruction or VMRESUME instruction) is detected as a VM-exit factor when switching the operation mode of the virtual CPU 108a, it corresponds to the factor 1361 of FIG. Emulation is performed by an entry instruction execution module, and processing is performed in place of the guest VMM 20 or the user program 110a.

あるいは、VM−exitの要因が、図4の通知条件1363に該当するゲストVMMへの通知条件の場合には、VM−exit条件検出モジュールを起動して同様にエミュレーションを行う。   Alternatively, when the cause of the VM-exit is a notification condition to the guest VMM corresponding to the notification condition 1363 in FIG. 4, the VM-exit condition detection module is activated to perform emulation in the same manner.

状態エリア選択部121は、ホストVMM保持データ11からVM−exitを発生した仮想CPU(この例では108a)の動作モードフラグ143を読み込んで、VMXルートモードとVMXノンルートモードの何れであるかを判定する。動作モードフラグ143が「0」のVMXルートモードであればゲストVMM20が動作していたので、状態エリア選択部121は、VM−exitを発生した仮想サーバ(この例では102a)のゲストVMCB22からホスト状態エリア222を読み込む。   The state area selection unit 121 reads the operation mode flag 143 of the virtual CPU (108a in this example) that generated the VM-exit from the host VMM holding data 11, and determines whether the VMX root mode or the VMX non-root mode is set. judge. If the VMX root mode with the operation mode flag 143 set to “0”, the guest VMM 20 was operating, so the state area selection unit 121 operates from the guest VMCB 22 of the virtual server (102a in this example) that generated the VM-exit to the host. The status area 222 is read.

一方、動作モードフラグ143が「1」のVMXノンルートモードであればユーザプログラム110aが動作していたので、状態エリア選択部121は、該当する仮想サーバ102aのゲストVMCB22からゲスト状態エリア221を読み込む。   On the other hand, if the VMX non-root mode in which the operation mode flag 143 is “1”, the user program 110a was operating, so the state area selection unit 121 reads the guest state area 221 from the guest VMCB 22 of the corresponding virtual server 102a. .

ゲストVMCB22からの読み込みが完了すると、CPU制御部12ではシャドウVMCB参照・更新モジュール123を起動する。シャドウVMCB参照・更新モジュール123は、状態エリア選択部121が読み込んだゲストVMCB22の情報を、VM−exitの処理対象である仮想CPU108aに対応するシャドウVMCB#0のゲスト状態エリア131に書き込んでシャドウVMCBを更新する。   When reading from the guest VMCB 22 is completed, the CPU control unit 12 activates the shadow VMCB reference / update module 123. The shadow VMCB reference / update module 123 writes the information of the guest VMCB 22 read by the state area selection unit 121 into the guest state area 131 of the shadow VMCB # 0 corresponding to the virtual CPU 108a that is the processing target of the VM-exit, and writes the shadow VMCB. Update.

シャドウVMCB#0のゲスト状態エリア131の更新が完了すると、CPU制御部12は仮想CPU108aの動作モードをVMXルートモードからVMXノンルートモードへ切り替えるため、動作モードフラグ143を「1」に更新し、物理CPU104のポインタ115に操作対象の仮想CPU108aのシャドウVMCB#0のアドレスをセットする。   When the update of the guest state area 131 of the shadow VMCB # 0 is completed, the CPU control unit 12 updates the operation mode flag 143 to “1” in order to switch the operation mode of the virtual CPU 108a from the VMX root mode to the VMX non-root mode. The shadow VMCB # 0 address of the virtual CPU 108a to be operated is set in the pointer 115 of the physical CPU 104.

そして、CPU制御部12は、VM−entry命令発行モジュール125を起動して、物理CPU104に対してVM−entry命令(VMRESUME命令)を発行する。   Then, the CPU control unit 12 activates the VM-entry instruction issuing module 125 and issues a VM-entry instruction (VMRESUME instruction) to the physical CPU 104.

物理CPU104はVM−entry命令を受け付けると、ポインタ115が指し示すシャドウVMCB#0のゲスト状態エリア131を読み込んで、状態エリア選択部121が選択した仮想サーバ102aのゲストVMM20またはユーザプログラム110aを実行する。   When the physical CPU 104 receives the VM-entry command, the physical CPU 104 reads the guest state area 131 of the shadow VMCB # 0 pointed to by the pointer 115 and executes the guest VMM 20 or the user program 110a of the virtual server 102a selected by the state area selection unit 121.

以上のように、仮想サーバ102aで仮想化機能を統合した次世代OSのゲストOS111aが稼動している場合、ホストVMM10のCPU制御部12は、物理CPU104のVM−exitを検出すると、シャドウVMCB#0の動作モードフラグ143を参照して、仮想CPU108aで実行中のプログラムがゲストVMM20とユーザプログラム110aの何れであるかを判定する。そして、CPU制御部12は、仮想CPU108aで実行していたプログラムに応じてゲスト状態エリア221またはホスト状態エリア222の内容をホストVMM10のシャドウVMCB#0のゲスト状態エリア131へ書き込んでからVM−entry命令を実行する。   As described above, when the guest OS 111a of the next generation OS that integrates the virtualization function is operating in the virtual server 102a, when the CPU control unit 12 of the host VMM 10 detects the VM-exit of the physical CPU 104, the shadow VMCB # With reference to the operation mode flag 143 of 0, it is determined whether the program being executed by the virtual CPU 108a is the guest VMM 20 or the user program 110a. Then, the CPU control unit 12 writes the contents of the guest state area 221 or the host state area 222 to the guest state area 131 of the shadow VMCB # 0 of the host VMM 10 according to the program executed by the virtual CPU 108a, and then the VM-entry. Execute the instruction.

こうして、仮想サーバ102aのゲストVMM20が保持するゲストVMCB22の情報で、ホストVMM10が保持するシャドウVMCB#0のゲスト状態エリア131を更新することにより、ゲストOS111aの仮想化機能を稼働させる仮想サーバ102aと、仮想化機能を用いない既存のOSを実行する仮想サーバ102nをひとつの物理サーバ101に統合することが可能となる。   Thus, by updating the guest state area 131 of the shadow VMCB # 0 held by the host VMM 10 with the information of the guest VMCB 22 held by the guest VMM 20 of the virtual server 102a, the virtual server 102a that operates the virtualization function of the guest OS 111a The virtual server 102n that executes an existing OS that does not use the virtualization function can be integrated into one physical server 101.

<ホストVMMの処理の詳細>
次に、ホストVMM10で行われる処理について、図5を参照しながら以下に説明する。図5は、仮想サーバ102a〜102nの稼働中に物理CPU104からのVM−exitを受信したときにホストVMM10のCPU制御部12が行う処理の一例を示すフローチャートである。なお、この例では、VM−exitの要因がVM−entry命令である場合を示す。
<Details of host VMM processing>
Next, processing performed by the host VMM 10 will be described below with reference to FIG. FIG. 5 is a flowchart illustrating an example of processing performed by the CPU control unit 12 of the host VMM 10 when receiving a VM-exit from the physical CPU 104 while the virtual servers 102a to 102n are operating. In this example, the VM-exit factor is a VM-entry instruction.

まず、S1では、ホストVMM10のCPU制御部12は、VM−exitの要因となった操作対象のゲストOS111a〜111n(以下、ゲストOSとする)に対応するホストVMM保持データ11の仮想化機能有効フラグ141を参照し、VM−exitを発生したゲストOSがVT−x機能を利用可能であるか否かを判定する。操作対象のゲストOSがVT−x機能を利用可能である場合にはS2ヘ進む。一方、操作対象のゲストOSがVT−x機能を利用しない場合(NTサーバまたは2000サーバなど)には、S15へ進んで、ホストVMM10は前記従来例に示した特許文献1または非特許文献1に記載されるような仮想マシン処理を行う。   First, in S <b> 1, the CPU control unit 12 of the host VMM 10 enables the virtualization function of the host VMM holding data 11 corresponding to the operation target guest OSs 111 a to 111 n (hereinafter referred to as guest OSs) that have caused the VM-exit. With reference to the flag 141, it is determined whether or not the guest OS that has generated the VM-exit can use the VT-x function. If the guest OS to be operated can use the VT-x function, the process proceeds to S2. On the other hand, when the guest OS to be operated does not use the VT-x function (NT server or 2000 server or the like), the process proceeds to S15, and the host VMM 10 is described in Patent Document 1 or Non-Patent Document 1 shown in the conventional example. Perform virtual machine processing as described.

S2では、ホストVMM10がVM−exitの要因となった仮想CPU108a〜108n(以下、仮想CPUとする)のVMXONフラグ142を参照し、この操作対象の仮想CPUがVMXモードであるか否かを判定する。VMXONフラグ142が「1」であれば仮想CPUはVMXモードであるのでS3へ進む。一方、VMXONフラグ142が「0」の場合には、仮想CPUが通常の動作モードであるので、上記と同様にS15ヘ進み、ホストVMM10は既存の仮想マシン処理を実行する。   In S2, the host VMM 10 refers to the VMXON flag 142 of the virtual CPUs 108a to 108n (hereinafter referred to as virtual CPUs) that caused the VM-exit, and determines whether or not the operation target virtual CPU is in the VMX mode. To do. If the VMXON flag 142 is “1”, since the virtual CPU is in the VMX mode, the process proceeds to S3. On the other hand, when the VMXON flag 142 is “0”, since the virtual CPU is in the normal operation mode, the process proceeds to S15 as described above, and the host VMM 10 executes the existing virtual machine processing.

S3では、ホストVMM10のCPU制御部12が、操作対象の仮想CPUの動作モードフラグ143を参照し、仮想CPUの動作モードがVMXルートモードとVMXノンルートモードの何れであるかを判定する。動作モードフラグ143が「0」の場合には仮想CPUがVMXルートモードであると判定してS4へ進む。一方、動作モードフラグ143が「1」の場合には、仮想CPUがVMXノンルートモードであると判定してS11へ進む。   In S3, the CPU control unit 12 of the host VMM 10 refers to the operation mode flag 143 of the operation target virtual CPU, and determines whether the operation mode of the virtual CPU is the VMX root mode or the VMX non-root mode. When the operation mode flag 143 is “0”, it is determined that the virtual CPU is in the VMX root mode, and the process proceeds to S4. On the other hand, when the operation mode flag 143 is “1”, it is determined that the virtual CPU is in the VMX non-root mode, and the process proceeds to S11.

S4では、CPU制御部12が物理CPU104から受信したVM−exitの発生要因を特定する。この例では、仮想CPUの動作モードがVMXルートモードであるので、CPU制御部12は、ゲストVMM20の状態(ステータス)を格納したゲスト状態エリア131を参照し、ゲストVMM20が発行したVM−entry命令をVM−exitの要因として特定する。   In S <b> 4, the CPU control unit 12 identifies the cause of occurrence of the VM-exit received from the physical CPU 104. In this example, since the operation mode of the virtual CPU is the VMX root mode, the CPU control unit 12 refers to the guest state area 131 in which the state (status) of the guest VMM 20 is stored, and the VM-entry instruction issued by the guest VMM 20 Is specified as a factor of VM-exit.

次に、S5ではCPU制御部12は、エミュレータ122からVM−entry命令実行モジュールを実行し、操作対象の仮想CPUをVMXノンルートモードへ切り替えるのに必要な所定の処理(状態エリア選択部121の起動など)をゲストVMM20に代わってエミュレートする。   Next, in S5, the CPU control unit 12 executes a VM-entry instruction execution module from the emulator 122, and performs predetermined processing (switching of the state area selection unit 121) necessary for switching the operation target virtual CPU to the VMX non-root mode. And the like are emulated on behalf of the guest VMM 20.

次に、S6ではホストVMM10のCPU制御部12は、仮想CPUの動作モードをVMXルートモードからVMXノンルートモードへ移行させるので、操作対象の仮想CPUの動作モードフラグ143を「1」に更新する。そして、S7では、CPU制御部12が操作対象のゲストVMM20の仮想CPU制御データ21からゲスト状態エリア221に格納されているゲストOSまたはアプリケーションのステータスを読み込む。   Next, in S6, since the CPU control unit 12 of the host VMM 10 shifts the operation mode of the virtual CPU from the VMX root mode to the VMX non-root mode, the operation mode flag 143 of the operation target virtual CPU is updated to “1”. . In S7, the CPU control unit 12 reads the status of the guest OS or application stored in the guest status area 221 from the virtual CPU control data 21 of the guest VMM 20 to be operated.

次に、S8において、CPU制御部12は、物理CPU104に対してVMPTLDR命令を発行して、操作対象の仮想CPUに対応するシャドウVMCBをアクティブに設定し、アクティブにしたシャドウVMCBのアドレスをポインタ115に設定する。このVMPTLDR命令(第2制御命令)により、ホストVMM10は、複数のシャドウVMCB#0〜#n−1の中から操作対象の仮想CPU(仮想サーバ)のシャドウVMCBを選択する。   Next, in S <b> 8, the CPU control unit 12 issues a VMPTLDR instruction to the physical CPU 104, sets the shadow VMCB corresponding to the virtual CPU to be operated to active, and sets the address of the activated shadow VMCB as a pointer 115. Set to. In response to this VMMPTLDR instruction (second control instruction), the host VMM 10 selects the shadow VMCB of the virtual CPU (virtual server) to be operated from among the plurality of shadow VMCBs # 0 to # n-1.

S9では、CPU制御部12が、上記S7で読み込んだゲスト状態エリア221の情報で操作対象のシャドウVMCB#0のゲスト状態エリア131を更新する。そして、S10でCPU制御部12は、物理CPU104に対してVM−entry命令を発行する。   In S9, the CPU control unit 12 updates the guest status area 131 of the shadow VMCB # 0 to be operated with the information of the guest status area 221 read in S7. In step S <b> 10, the CPU control unit 12 issues a VM-entry instruction to the physical CPU 104.

VM−entry命令を受け付けた物理CPU104は、ポインタ115で指定されたシャドウVMCBのゲスト状態エリア131の内容に基づいて、操作対象の仮想サーバのユーザプログラム(ゲストOSまたはアプリケーション)を実行する。なお、物理CPU104は、VM−entry命令を受け付けると、実行していたホストVMM10のステータスをシャドウVMCBのホスト状態エリア132へ格納し、次回の呼び出しに備える。   The physical CPU 104 that has received the VM-entry command executes the user program (guest OS or application) of the operation target virtual server based on the contents of the guest status area 131 of the shadow VMCB designated by the pointer 115. When receiving the VM-entry instruction, the physical CPU 104 stores the status of the host VMM 10 that has been executed in the host status area 132 of the shadow VMCB and prepares for the next call.

一方、上記S3で動作モードフラグ143が「1」と判定された場合は、操作対象の仮想CPUがユーザプログラムを実行中のVMXノンルートモードであるので、S11の処理を行う。   On the other hand, when the operation mode flag 143 is determined to be “1” in S3, since the operation target virtual CPU is in the VMX non-root mode in which the user program is being executed, the process of S11 is performed.

S11では、CPU制御部12が図4のVM−exitの要因リストを参照し、通知条件1363からゲストVMMへのVM−exit通知条件を検索する。この例では、VM−exitの要因となったVM−entry命令(VMLAUNCH、VMRESUME命令)であるので、VM−exit通知条件に一致する。   In S <b> 11, the CPU control unit 12 refers to the VM-exit factor list in FIG. 4 and searches for a VM-exit notification condition from the notification condition 1363 to the guest VMM. In this example, since it is a VM-entry instruction (VMLAUNCH, VMRESUME instruction) that causes the VM-exit, it matches the VM-exit notification condition.

そして、CPU制御部12は、S12で図2のVM−exit条件検出モジュールを実行し、操作対象の仮想CPUをVMXルートモードへ切り替えるのに必要な所定の処理(状態エリア選択部121の起動など)をユーザプログラムに代わってエミュレートする。   Then, the CPU control unit 12 executes the VM-exit condition detection module of FIG. 2 in S12, and performs predetermined processing (such as activation of the state area selection unit 121) necessary for switching the operation target virtual CPU to the VMX root mode. ) On behalf of the user program.

次に、S13では、操作対象の仮想CPUの動作モードをVMXノンルートモードからVMXルートモードへ移行させるため、CPU制御部12が操作対象の仮想CPUの動作モードフラグ143を「0」にリセットする。そして、S14では、CPU制御部12が操作対象のゲストVMM20の仮想CPU制御データ21からホスト状態エリア221に格納されているゲストVMM20のステータスを読み込む。   Next, in S13, the CPU control unit 12 resets the operation mode flag 143 of the operation target virtual CPU to “0” in order to shift the operation mode of the operation target virtual CPU from the VMX non-root mode to the VMX root mode. . In S14, the CPU control unit 12 reads the status of the guest VMM 20 stored in the host status area 221 from the virtual CPU control data 21 of the guest VMM 20 to be operated.

S14の処理が完了すると、上記S8〜S10を実行し、CPU制御部12は、上記S14で読み込んだホスト状態エリア222の情報で操作対象のシャドウVMCBのゲスト状態エリア131を更新し、ゲストVMM20のステータスをセットしてから物理CPU104に対してVM−entry命令を発行する。   When the processing of S14 is completed, S8 to S10 are executed, and the CPU control unit 12 updates the guest status area 131 of the shadow VMCB to be operated with the information of the host status area 222 read in S14, and the guest VMM 20 After setting the status, a VM-entry instruction is issued to the physical CPU 104.

この結果、VM−entry命令を受け付けた物理CPU104は、ポインタ115で指定されたシャドウVMCBのゲスト状態エリア131の内容に基づいて、操作対象の仮想サーバのゲストVMM20を実行する。   As a result, the physical CPU 104 that has received the VM-entry command executes the guest VMM 20 of the operation target virtual server based on the contents of the guest status area 131 of the shadow VMCB designated by the pointer 115.

このように、ゲストOSが仮想化機能を統合した次世代OSである場合、ホストVMM10は、仮想CPUの動作モードと、発生したVM−exitの要因に応じてシャドウVMCBのゲスト状態エリア131に書き込むステータスを、ゲストVMMまたはユーザプログラムの何れか一方から選択する。そして、ホストVMM10が物理CPU104(第1の仮想CPU)に対してVM−entry命令を発行することで、仮想サーバ上でゲストVMMと、このゲストVMMが提供する第2の仮想CPU上で稼動するユーザプログラムを切り替えて実行することが可能となり、ゲストVMMは仮想サーバ上に複数の仮想化環境(ユーザプログラム)を提供することができる。   As described above, when the guest OS is a next-generation OS in which the virtualization function is integrated, the host VMM 10 writes in the guest status area 131 of the shadow VMCB according to the operation mode of the virtual CPU and the generated VM-exit factor. The status is selected from either the guest VMM or the user program. When the host VMM 10 issues a VM-entry instruction to the physical CPU 104 (first virtual CPU), the host VMM 10 operates on the guest VMM on the virtual server and on the second virtual CPU provided by the guest VMM. User programs can be switched and executed, and the guest VMM can provide a plurality of virtual environments (user programs) on the virtual server.

なお、上記S1の判定でゲストOSが仮想化機能を利用しない場合、または上記S2の判定で、仮想CPUが物理CPU104のVT−x機能を利用しない場合は、S15において、前記従来例に示した特許文献1または非特許文献1の記載に準じた仮想マシン処理をホストVMM10で行えばよい。   When the guest OS does not use the virtualization function in the determination of S1 or when the virtual CPU does not use the VT-x function of the physical CPU 104 in the determination of S2, the conventional example is shown in S15. Virtual machine processing according to the description in Patent Document 1 or Non-Patent Document 1 may be performed by the host VMM 10.

S15の仮想マシン処理は、例えば、図1に示した仮想サーバ102nのゲストOS111nは、既存のOSであり、このゲストOS111nまたはアプリケーション112n(ユーザプログラム110n)が特権命令などの所定の命令を実行すると、上述したように物理CPU104はVM−exitの発生をホストVMM10に通知する。   In the virtual machine process of S15, for example, the guest OS 111n of the virtual server 102n shown in FIG. 1 is an existing OS, and this guest OS 111n or application 112n (user program 110n) executes a predetermined command such as a privileged command. As described above, the physical CPU 104 notifies the host VMM 10 of the occurrence of the VM-exit.

ホストVMM10は、物理CPU104からのVM−exitの通知を受けると、ユーザプログラム110n(仮想CPU108n)のステータスをシャドウVMCB#n−1のゲスト状態エリア131に格納する。そして、ホストVMM10は、ポインタ115のアドレスをホストVMM10のステータスを格納したホスト状態エリアに設定して、所定の処理を実行する。   When receiving the VM-exit notification from the physical CPU 104, the host VMM 10 stores the status of the user program 110n (virtual CPU 108n) in the guest state area 131 of the shadow VMCB # n-1. Then, the host VMM 10 sets the address of the pointer 115 in the host state area in which the status of the host VMM 10 is stored, and executes predetermined processing.

ホストVMM10は、特権命令など所定の処理が完了すると、ホストVMM10のステータスをホスト状態エリア132へ格納し、ポインタ115のアドレスにゲスト状態エリア131を設定してから、VM−entry命令(VMRESUME命令)を発行して、制御を仮想CPU108nに移動してユーザプログラム110nの実行を再開する。   When a predetermined process such as a privileged instruction is completed, the host VMM 10 stores the status of the host VMM 10 in the host state area 132, sets the guest state area 131 to the address of the pointer 115, and then a VM-entry instruction (VMRESUME instruction) To transfer control to the virtual CPU 108n and resume execution of the user program 110n.

このように、本発明によれば、仮想化機能を統合した次世代OSと、既存のOSをひとつの物理サーバ101へ統合することが可能となって、物理サーバの数を削減してサーバの運用管理コストを削減することが可能となる。   As described above, according to the present invention, it is possible to integrate a next-generation OS that integrates virtualization functions and an existing OS into one physical server 101, and reduce the number of physical servers. Operation management costs can be reduced.

さらに、上述のように、ホストVMM10は次世代OSに対して仮想CPUがVT−x機能を提供するように見せかけることができ、仮想化ソフトウェアを統合したOSを確実に稼働させることが可能となる。また、本発明のホストVMM10によれば、前記従来例のシミュレータのように、命令列の変換などのオーバーヘッドがなく、仮想計算機の性能を低下させることなく、仮想化機能を統合したOSを仮想サーバで実行することが可能となるのである。   Further, as described above, the host VMM 10 can make the virtual CPU provide the VT-x function to the next-generation OS, and can reliably operate the OS integrated with the virtualization software. . In addition, according to the host VMM 10 of the present invention, unlike the conventional simulator, there is no overhead such as instruction sequence conversion, and an OS that integrates the virtualization function without reducing the performance of the virtual machine is virtual server. It is possible to execute with.

また、本発明では、複数の仮想CPU108a〜108nに対応して、複数のシャドウVMCB#0〜#n−1を設けたので、物理サーバ101で複数のゲストVMM20を実行する場合でも、シャドウVMCB#0〜#n−1を切り替えるだけで迅速に処理を切り替えることが可能となる。これにより、物理サーバ101に複数の次世代OSを統合した場合でも、仮想サーバの性能を維持することが可能となる。   In the present invention, since a plurality of shadow VMCBs # 0 to # n−1 are provided corresponding to the plurality of virtual CPUs 108a to 108n, even when a plurality of guest VMMs 20 are executed on the physical server 101, the shadow VMCB # It is possible to switch processing quickly by simply switching from 0 to # n-1. Thereby, even when a plurality of next-generation OSs are integrated into the physical server 101, the performance of the virtual server can be maintained.

図6は、仮想サーバの稼働中にVMCLEAR命令の実行に起因して、物理CPU104からのVM−exitを受信したときにホストVMM10のCPU制御部12が行う処理の一例を示すフローチャートである。   FIG. 6 is a flowchart illustrating an example of processing performed by the CPU control unit 12 of the host VMM 10 when receiving a VM-exit from the physical CPU 104 due to execution of the VMCLEAR instruction while the virtual server is operating.

S21〜S23は、上記図5のS1〜S3と同様であり、ホストVMM10のCPU制御部12が、VM−exitの要因となった操作対象のゲストOSがVT−x機能を利用可能であるか否かを判定し、操作対象の仮想CPUのVMXONフラグ142を参照して、操作対象の仮想CPUがVT−x機能を使用中か否かを判定する。操作対象のゲストOSがVT−x機能を利用しない場合や、VMXONフラグ142が「0」である仮想CPUが通常の動作モードの場合は、S35ヘ進み、ホストVMM10は既存の仮想マシン処理を実行する。   S21 to S23 are the same as S1 to S3 in FIG. 5 described above, and the CPU controller 12 of the host VMM 10 can use the VT-x function by the operation target guest OS that causes the VM-exit. It is determined whether or not the operation target virtual CPU is using the VT-x function with reference to the VMXON flag 142 of the operation target virtual CPU. If the operation target guest OS does not use the VT-x function or if the virtual CPU whose VMXON flag 142 is “0” is in the normal operation mode, the process proceeds to S35, and the host VMM 10 executes the existing virtual machine processing To do.

さらに、CPU制御部12は、操作対象の仮想CPUの動作モードフラグ143を参照し、仮想CPUの動作モードがVMXルートモードとVMXノンルートモードの何れであるかを判定し、VMXルートモードであればS24へ進み、VMXノンルートモードであればS30へ進む。   Further, the CPU control unit 12 refers to the operation mode flag 143 of the operation target virtual CPU to determine whether the operation mode of the virtual CPU is the VMX root mode or the VMX non-root mode. If it is VMX non-root mode, the process proceeds to S30.

S24では、CPU制御部12は、物理CPU104から受信したVM−exitから要因を特定する。この例では、CPU制御部12がゲスト状態エリア131を参照して、VM−exitの要因としてゲストVMM20のVMCLEAR命令を特定する。   In S <b> 24, the CPU control unit 12 identifies a factor from the VM-exit received from the physical CPU 104. In this example, the CPU control unit 12 refers to the guest state area 131 and specifies the VMCLEAR instruction of the guest VMM 20 as the cause of the VM-exit.

次に、S25ではCPU制御部12のエミュレータ122からVMCLEAR命令実行モジュールを起動してエミュレーションを行う。S26では、エミュレーションにより、物理CPU104の動作状態(ステータス)を読み込んで、操作対象の仮想CPUに対応するシャドウVMCBを更新する。これにより、物理CPU104のステータスをシャドウVMCBに反映させる。   In step S25, emulation is performed by activating the VMCLEAR instruction execution module from the emulator 122 of the CPU control unit 12. In S26, the operation state (status) of the physical CPU 104 is read by emulation, and the shadow VMCB corresponding to the operation target virtual CPU is updated. As a result, the status of the physical CPU 104 is reflected in the shadow VMCB.

S27では、CPU制御部12が操作対象の仮想CPUに対応するシャドウVMCBのゲスト状態エリア131に格納されているステータスを読み込む。   In S27, the CPU control unit 12 reads the status stored in the guest state area 131 of the shadow VMCB corresponding to the virtual CPU to be operated.

次に、S28において、CPU制御部12は、シャドウVMCBのゲスト状態エリア131から読み込んだステータスをゲストVMM20のゲスト状態エリア221へ書き込んで更新する。これにより、ゲストVMM20のゲスト状態エリア221は、物理CPU104のステータスと同期する。   Next, in S28, the CPU control unit 12 writes the status read from the guest status area 131 of the shadow VMCB into the guest status area 221 of the guest VMM 20 and updates it. As a result, the guest state area 221 of the guest VMM 20 is synchronized with the status of the physical CPU 104.

S29では、CPU制御部12が、ポインタ115のアドレスを操作対象の仮想CPUに対応するシャドウVMCBのゲスト状態エリア131に設定してから、物理CPU104に対してVM−entry命令を発行する。   In S <b> 29, the CPU control unit 12 sets the address of the pointer 115 in the guest state area 131 of the shadow VMCB corresponding to the operation target virtual CPU, and then issues a VM-entry instruction to the physical CPU 104.

VM−entry命令を受け付けた物理CPU104は、ポインタ115で指定されたシャドウVMCBのゲスト状態エリア131の内容に基づいて、操作対象の仮想サーバのユーザプログラム(ゲストOSまたはアプリケーション)を実行する。   The physical CPU 104 that has received the VM-entry command executes the user program (guest OS or application) of the operation target virtual server based on the contents of the guest status area 131 of the shadow VMCB designated by the pointer 115.

一方、上記S23で動作モードフラグ143が「1」と判定された場合は、操作対象の仮想CPUがVMXノンルートモードであるので、S30の処理を行う。S30では、図4のVM−exitの要因リストを参照し、VM−exitの要因を解析する。CPU制御部12は、通知条件1363からゲストVMMへのVM−exit通知条件を検索する。この例では、VM−exitの要因となったVMCLEAR命令は、VM−exit通知条件に一致する。   On the other hand, if the operation mode flag 143 is determined to be “1” in S23, the operation target virtual CPU is in the VMX non-root mode, so the process of S30 is performed. In S30, the VM-exit factor list in FIG. 4 is referenced to analyze the VM-exit factor. The CPU control unit 12 searches for a VM-exit notification condition from the notification condition 1363 to the guest VMM. In this example, the VMCLEAR instruction that caused the VM-exit matches the VM-exit notification condition.

そして、S31ではCPU制御部12がゲストVMM20に対して規定外命令エラーを通知する。すなわち、ユーザプログラムの権限ではVMCLEAR命令を実行できなかったことを、ゲストVMM20へ通知する。   In S31, the CPU control unit 12 notifies the guest VMM 20 of an unspecified instruction error. That is, it notifies the guest VMM 20 that the VMCLEAR instruction could not be executed with the authority of the user program.

次に、S32ではCPU制御部12が、操作対象の仮想CPUの動作モードをVMXノンルートモードからVMXルートモードへ移行させるので、操作対象の仮想CPUの動作モードフラグ143を「0」にリセットする。   Next, in S32, the CPU control unit 12 shifts the operation mode of the operation target virtual CPU from the VMX non-root mode to the VMX root mode, so the operation mode flag 143 of the operation target virtual CPU is reset to “0”. .

S33では、CPU制御部12が操作対象のゲストVMM20の仮想CPU制御データ21から、ホスト状態エリア221に格納されているゲストVMM20のステータスを読み込む。   In S33, the CPU control unit 12 reads the status of the guest VMM 20 stored in the host state area 221 from the virtual CPU control data 21 of the guest VMM 20 to be operated.

S34では、CPU制御部12が、上記S33で読み込んだホスト状態エリア222のステータスを、操作対象のシャドウVMCBのゲスト状態エリア131に書き込んでシャドウVMCBを更新する。その後、上記S29では、CPU制御部12がポインタ115のアドレスをゲスト状態エリア131に設定してから、物理CPU104に対してVM−entry命令を発行する。   In S34, the CPU control unit 12 writes the status of the host status area 222 read in S33 to the guest status area 131 of the shadow VMCB to be operated and updates the shadow VMCB. Thereafter, in S29, the CPU control unit 12 sets the address of the pointer 115 in the guest state area 131, and then issues a VM-entry instruction to the physical CPU 104.

この結果、VM−entry命令を受け付けた物理CPU104は、ポインタ115で指定されたシャドウVMCBのゲスト状態エリア131の内容に基づいて、操作対象の仮想サーバのゲストVMM20を実行する。   As a result, the physical CPU 104 that has received the VM-entry command executes the guest VMM 20 of the operation target virtual server based on the contents of the guest status area 131 of the shadow VMCB designated by the pointer 115.

なお、上記S21の判定でゲストOSが仮想化機能を利用しない場合、または上記S22の判定で、仮想CPUが物理CPU104のVT−x機能を利用しない場合は、S35において、前記図5のS15と同様にして、従来例に示した特許文献1または非特許文献1の記載に準じた仮想マシン処理をホストVMM10で行えばよい。   If the guest OS does not use the virtualization function in the determination in S21 or if the virtual CPU does not use the VT-x function of the physical CPU 104 in the determination in S22, in S35, S15 in FIG. Similarly, the virtual machine processing according to the description of Patent Document 1 or Non-Patent Document 1 shown in the conventional example may be performed by the host VMM 10.

このように、ゲストVMM20がVMCLEAR命令を発行した場合には、ホストVMM10は、物理CPU104の動作状態(ステータス)を取得してシャドウVMCBのゲスト状態エリア131を、取得した動作状態で更新する。そして、ホストVMM10は、シャドウVMCBのゲスト状態エリア131のステータスを、ゲストVMCBのゲスト状態エリア221に反映させることで、物理CPU104のステータスとホストVMM10のゲスト状態エリア131及びゲストVMM20上のゲスト状態エリア221のステータスを同期させることができる。   As described above, when the guest VMM 20 issues the VMCLEAR instruction, the host VMM 10 acquires the operation state (status) of the physical CPU 104 and updates the guest state area 131 of the shadow VMCB with the acquired operation state. Then, the host VMM 10 reflects the status of the guest status area 131 of the shadow VMCB in the guest status area 221 of the guest VMCB, so that the status of the physical CPU 104, the guest status area 131 of the host VMM 10 and the guest status area on the guest VMM 20 The status of 221 can be synchronized.

これにより、仮想化機能を統合した次世代OSは、仮想サーバ上で仮想環境を円滑に提供することが可能となる。   As a result, the next-generation OS that integrates the virtualization function can smoothly provide a virtual environment on the virtual server.

図7は、仮想サーバの稼働中にCPUID命令(第3制御命令)の実行に起因して、物理CPU104からのVM−exitを受信したときにホストVMM10のCPU制御部12が行う処理の一例を示すフローチャートである。   FIG. 7 illustrates an example of processing performed by the CPU control unit 12 of the host VMM 10 when a VM-exit is received from the physical CPU 104 due to execution of a CPUID command (third control command) during operation of the virtual server. It is a flowchart to show.

まず、S41では、図5のS3と同様に、ホストVMM10のCPU制御部12は、VM−exitの要因となった操作対象の仮想CPUの動作モードフラグ143を参照し、仮想CPUの動作モードがVMXルートモードとVMXノンルートモードの何れであるかを判定する。動作モードフラグ143が「0」の場合には仮想CPUがVMXルートモードであると判定してS42へ進む。一方、動作モードフラグ143が「1」の場合には、仮想CPUがVMXノンルートモードであると判定してS41へ進む。   First, in S41, as in S3 of FIG. 5, the CPU control unit 12 of the host VMM 10 refers to the operation mode flag 143 of the operation target virtual CPU that causes the VM-exit, and the operation mode of the virtual CPU is set. It is determined whether the VMX root mode or the VMX non-root mode. When the operation mode flag 143 is “0”, it is determined that the virtual CPU is in the VMX root mode, and the process proceeds to S42. On the other hand, when the operation mode flag 143 is “1”, it is determined that the virtual CPU is in the VMX non-root mode, and the process proceeds to S41.

S42では、図5のS4と同様にして、CPU制御部12が物理CPU104から受信したVM−exitの発生要因をゲスト状態エリア131の値から特定する。この例では、VMXルートモードであるので、CPU制御部12は、ゲストVMM20のCPUID命令をVM−exitの発生要因として特定する。   In S <b> 42, as in S <b> 4 of FIG. 5, the CPU control unit 12 identifies the occurrence factor of the VM-exit received from the physical CPU 104 from the value in the guest state area 131. In this example, since it is the VMX root mode, the CPU control unit 12 specifies the CPUID command of the guest VMM 20 as a cause of occurrence of VM-exit.

S43では、図5のS1と同様に、CPU制御部12は、VM−exitの要因となった操作対象のゲストOSに対応するホストVMM保持データ11の仮想化機能有効フラグ141を参照し、VM−exitを発生したゲストOSがVT−x機能を利用可能であるか否かを判定する。操作対象のゲストOSがVT−x機能を利用可能である場合にはS44ヘ進む。一方、操作対象のゲストOSがVT−x機能を利用しない場合には、S45へ進む。   In S43, as in S1 of FIG. 5, the CPU control unit 12 refers to the virtualization function enable flag 141 of the host VMM holding data 11 corresponding to the operation target guest OS that has caused the VM-exit, and then executes the VM. -It is determined whether or not the guest OS that generated the exit can use the VT-x function. If the operation target guest OS can use the VT-x function, the process proceeds to S44. On the other hand, if the guest OS to be operated does not use the VT-x function, the process proceeds to S45.

S44では、CPUID命令の戻り値を示すリターンレジスタ(IA−32の場合ECX)の所定のビット(CPUID.1.ECX[5]=1)を1に設定して、VT−x機能が有効であることを設定する。   In S44, a predetermined bit (CPUID.1.ECX [5] = 1) of the return register (ECX in the case of IA-32) indicating the return value of the CPUID instruction is set to 1, and the VT-x function is enabled. Set that there is.

一方、S45では、CPUID命令の戻り値を示すリターンレジスタ(IA−32の場合ECX)の所定のビットを0に設定して、VT−x機能が無効であることを設定する。   On the other hand, in S45, a predetermined bit of the return register (ECX in the case of IA-32) indicating the return value of the CPUID instruction is set to 0 to set that the VT-x function is invalid.

次に、S46においてCPU制御部12は、エミュレータ122からCPUID命令実行モジュールを起動して、ゲストVMM20もしくはユーザプログラムへ通知すべき例外のチェック等を行い、チェック結果をゲスト状態エリア131に格納する。   Next, in S46, the CPU control unit 12 activates the CPUID instruction execution module from the emulator 122, checks for exceptions to be notified to the guest VMM 20 or the user program, and stores the check result in the guest status area 131.

S47では、CPU制御部12が物理CPU104に対してVM−entry命令を発行して、仮想サーバに制御を移す。   In S <b> 47, the CPU control unit 12 issues a VM-entry command to the physical CPU 104 and transfers control to the virtual server.

一方、上記S41の判定で、動作モードフラグ143が「1」となるユーザプログラムを実行していた場合(VMXノンルートモード)にはS48ヘ進み、ユーザプログラムを実行している期間中のVM−exitの要因を解析する。S48では、CPU制御部12が物理CPU104から受信したVM−exitの発生要因をゲスト状態エリア131の値から特定する。この例では、VMXノンルートモードであるので、CPU制御部12は、ゲストOSまたはアプリケーションのCPUID命令をVM−exitの発生要因として特定する。   On the other hand, if it is determined in S41 that the user program whose operation mode flag 143 is “1” is being executed (VMX non-root mode), the process proceeds to S48, and the VM− during the period during which the user program is being executed. Analyze the cause of exit. In S <b> 48, the CPU control unit 12 specifies the generation factor of the VM-exit received from the physical CPU 104 from the value in the guest state area 131. In this example, since it is a VMX non-root mode, the CPU control unit 12 specifies the CPUID command of the guest OS or application as a cause of occurrence of VM-exit.

S49では、CPU制御部12が、ユーザプログラム実行中のCPUID命令に起因するVM−exitについて、ゲストVMM20への通知が必要であるか否かを判定する。この判定は、CPU制御部12が、仮想CPU制御データ21のゲストVMCB22のVM実行制御領域223に予め設定された情報を参照して、判定を行う。CPUID命令に伴うVM−exitをゲストVMM20へ通知する必要があればS50へ進む。一方、ゲストVMM20へのVM−exitの通知が不要であればS43へ進み、上述のS43移行の処理を実行する。   In S49, the CPU control unit 12 determines whether or not notification to the guest VMM 20 is necessary for the VM-exit caused by the CPUID command during execution of the user program. This determination is performed by the CPU control unit 12 referring to information preset in the VM execution control area 223 of the guest VMCB 22 in the virtual CPU control data 21. If it is necessary to notify the guest VMM 20 of the VM-exit accompanying the CPUID command, the process proceeds to S50. On the other hand, if the notification of the VM-exit to the guest VMM 20 is unnecessary, the process proceeds to S43, and the above-described processing of S43 is executed.

S50では、ゲストVMM20へVM−exitの通知を行うため、CPU制御部12はVM−exitエミュレータを実行し、S51で操作対象の仮想CPUの動作モードフラグ143を「0」にリセットしてVMXルートモードへ切り替える。   In S50, in order to notify the VMM 20 of the VM-exit, the CPU control unit 12 executes the VM-exit emulator, and in S51, resets the operation mode flag 143 of the operation target virtual CPU to “0” and the VMX route. Switch to mode.

次に、S52でCPU制御部12は、操作対象のゲストVMCB22のホスト状態エリア222のステータスを読み込む。S53ではCPU制御部12が、上記読み込んだステータスを、操作対象の仮想CPUのシャドウVMCBのゲスト状態エリア131に書き込んで更新を行う。その後、S47で、CPU制御部12が物理CPU104に対してVM−entry命令を発行して制御をゲストVMM20へ移す。   Next, in S52, the CPU control unit 12 reads the status of the host status area 222 of the guest VMCB 22 to be operated. In S53, the CPU control unit 12 writes and updates the read status in the guest status area 131 of the shadow VMCB of the virtual CPU to be operated. Thereafter, in S47, the CPU control unit 12 issues a VM-entry instruction to the physical CPU 104 to transfer control to the guest VMM 20.

以上のように、ゲストVMM20がCPUID命令を発行した場合と、CPUID命令に起因するVM−exitをゲストVMM20へ通知しない場合では、仮想化機能有効フラグ141の設定に応じてリターンレジスタの値を設定した後、CPU制御部12は、VM−entry命令を発行して、ゲストVMM20またはユーザプログラムへ制御を戻すことができる。また、ユーザプログラムがCPUID命令を発行し、ゲストVMM20へVM−exitの通知が必要な場合では、シャドウVMCBのゲスト状態エリア131を、ゲストVMCB22のホスト状態エリア222の内容で更新して、制御をゲストVMM20へ移すことができる。   As described above, when the guest VMM 20 issues the CPUID instruction and when the VM-exit resulting from the CPUID instruction is not notified to the guest VMM 20, the value of the return register is set according to the setting of the virtualization function enable flag 141. After that, the CPU control unit 12 can issue a VM-entry instruction to return control to the guest VMM 20 or the user program. When the user program issues a CPUID command and the VM-exit needs to be notified to the guest VMM 20, the guest status area 131 of the shadow VMCB is updated with the contents of the host status area 222 of the guest VMCB 22, and control is performed. It can be transferred to the guest VMM 20.

以上のように、本第1実施形態によれば、ホストVMM10がゲストOSやアプリケーションの状態と仮想CPUの状態を監視してシャドウVMCBのゲスト状態エリア131を書き換えることで、仮想サーバの性能を低下させることなく、仮想化ソフトウェアを統合したOSを確実に稼働させることが可能となる。そして、ひとつの物理サーバ101で仮想化機能を統合した次世代OSと、既存のOSを共存させることが可能となって、サーバ統合を効率よく行うことで、サーバの運用コストを削減することが可能となる。   As described above, according to the first embodiment, the host VMM 10 monitors the guest OS or application state and the virtual CPU state and rewrites the guest state area 131 of the shadow VMCB, thereby reducing the performance of the virtual server. Therefore, it is possible to reliably operate an OS integrated with virtualization software. Then, it becomes possible to coexist with the existing OS and the next generation OS that integrates the virtualization function in one physical server 101, and server operation costs can be reduced by efficiently performing server integration. It becomes possible.

なお、ホストVMM10が管理コンソール300に提供するユーザーインターフェースとしては、例えば、図8に示すようなGUIで構成される。図8は、各仮想サーバ毎に仮想化機能を有効にするか無効にするかを設定するユーザーインターフェースを示す。図中「VM#」は、仮想サーバの識別子を示し、「現在設定」は「ON」であれば仮想化機能が有効出ることを示し、「OFF」であれば仮想化機能が無効であることを示す。そして、「新規設定」に「ON」または「OFF」を設定してから、画面左下の「OK」をクリックすることにより、所望の仮想サーバについて仮想化機能の有効または無効を切り替えることができる。すなわち、ホストVMM10は、ユーザーインターフェース301から入力された「新規設定」の値に基づいて、ホストVMM保持データ11のうち、該当する仮想サーバの仮想化機能有効フラグ141に「1」または「0」を設定する。これにより、ユーザーインターフェース301から入力された設定値を任意の仮想サーバへ反映させることができる。   Note that the user interface provided by the host VMM 10 to the management console 300 is configured with a GUI as shown in FIG. 8, for example. FIG. 8 shows a user interface for setting whether to enable or disable the virtualization function for each virtual server. In the figure, “VM #” indicates the identifier of the virtual server, “current setting” indicates that the virtualization function is valid if “ON”, and the virtualization function is invalid if “OFF”. Indicates. Then, by setting “ON” or “OFF” in “New setting” and clicking “OK” in the lower left of the screen, the virtualization function can be enabled or disabled for a desired virtual server. That is, the host VMM 10 sets “1” or “0” in the virtualization function enable flag 141 of the corresponding virtual server in the host VMM holding data 11 based on the value of “new setting” input from the user interface 301. Set. Thereby, the setting value input from the user interface 301 can be reflected on an arbitrary virtual server.

<第2実施形態>
図9は、第2の実施形態を示し、前記第1実施形態に示した物理CPU104のVT−x機能を、前記従来例(非特許文献2)に示したAMD−V(Virtualization)に置き換えたものである。
<Second Embodiment>
FIG. 9 shows the second embodiment, in which the VT-x function of the physical CPU 104 shown in the first embodiment is replaced with AMD-V (Virtualization) shown in the conventional example (Non-Patent Document 2). Is.

図9において、AMD−Vを実装した物理CPU104aは、前記第1実施形態に示したホストVMM10のシャドウVMCBのアドレスを指し示すポインタ115に加えて、ホスト状態エリア132のアドレスを指し示すポインタ118を備える。   In FIG. 9, the physical CPU 104a on which AMD-V is mounted includes a pointer 118 that points to the address of the host status area 132 in addition to the pointer 115 that points to the address of the shadow VMCB of the host VMM 10 described in the first embodiment.

AMD−Vを備える物理CPU104aは、VM−entry命令に代わって、VMRUN命令を実行するとホストVMM10を実行するホストモードからゲストVMM20またはユーザプログラムを実行するゲストモードへの切り換え行う。そして、ホストVMM10は、AMD−Vの仕様に応じて、次の点が前記第1実施形態のVT−x機能と相違する。   When executing the VMRUN instruction instead of the VM-entry instruction, the physical CPU 104a provided with AMD-V switches from the host mode in which the host VMM 10 is executed to the guest VMM 20 or the guest mode in which the user program is executed. The host VMM 10 is different from the VT-x function of the first embodiment in the following points according to the AMD-V specification.

ホストVMM保持データ11のうち、前記第1実施形態のVMXONフラグ142を削除し、仮想サーバ毎の仮想化機能有効フラグ141と、仮想CPU108a〜n毎の動作モードフラグ143を備える。そして、ホストVMM保持データ11の物理CPU制御データは、図10で示すように、仮想CPU毎のホスト状態エリア132と、仮想CPU毎のシャドウVMCB#0〜#n−1に、ゲスト状態エリア131と制御エリア137を備える。なお、シャドウVMCB#0〜#n−1の制御エリア137は、前記第1実施形態のVM−exit情報領域136に相当する情報を格納する。   The VMXON flag 142 of the first embodiment is deleted from the host VMM retained data 11, and a virtual function valid flag 141 for each virtual server and an operation mode flag 143 for each virtual CPU 108a-n are provided. As shown in FIG. 10, the physical CPU control data of the host VMM holding data 11 includes the guest status area 131 in the host status area 132 for each virtual CPU and the shadow VMCBs # 0 to # n−1 for each virtual CPU. And a control area 137. Note that the control areas 137 of the shadow VMCBs # 0 to # n−1 store information corresponding to the VM-exit information area 136 of the first embodiment.

すなわち、制御エリア137には、図11で示すように、予め設定された#VMEXIT(前記第1実施形態のVM−exitに相当)の発生要因のコードを示すEXITCODE1371と、コードの名称1372と、このコードがVMRUN命令に起因することを示す判定結果1373と、#VMEXITをゲストVMM20へ通知することを示す通知条件1374が含まれている。   That is, in the control area 137, as shown in FIG. 11, EXITCODE 1371 indicating the code of the occurrence factor of preset #VMEXIT (corresponding to the VM-exit of the first embodiment), the code name 1372, A determination result 1373 indicating that this code is caused by the VMRUN instruction, and a notification condition 1374 indicating that #VMEXIT is notified to the guest VMM 20 are included.

CPU制御部12のエミュレータ122は、VM−entry命令に代わって、VMRUN命令実行モジュールを備え、VMCLEAR命令実行モジュールを削除した。また、CPU制御部12は、前記第1実施形態のVM−entry命令発行部に代わって、物理CPU104にVMRUN命令を発行するVMRUN命令発行部125Aを備える。   The emulator 122 of the CPU control unit 12 includes a VMRUN instruction execution module instead of the VM-entry instruction, and deletes the VMCLEAR instruction execution module. In addition, the CPU control unit 12 includes a VMRUN instruction issuing unit 125A that issues a VMRUN instruction to the physical CPU 104 in place of the VM-entry instruction issuing unit of the first embodiment.

次に、ホストVMM10が仮想サーバ102a〜102nへ提供する仮想CPU108a〜108nも、物理CPU104aの構成の変更に応じて、ゲストVMM20内のゲスト状態エリア221のアドレスを指し示すポインタ116に加えて、ホスト状態エリア222のアドレスを指し示すポインタ117を備える。なお、ゲストVMM20は、前記第1実施形態の仮想サーバ102aと同じく、仮想化機能を統合した次世代OSをゲストOS111aに採用した場合に仮想サーバ102aで稼働するものである。   Next, the virtual CPUs 108a to 108n provided by the host VMM 10 to the virtual servers 102a to 102n also receive the host status in addition to the pointer 116 indicating the address of the guest status area 221 in the guest VMM 20 in accordance with the change in the configuration of the physical CPU 104a. A pointer 117 indicating the address of the area 222 is provided. Note that the guest VMM 20 operates on the virtual server 102a when the next-generation OS that integrates the virtualization function is adopted as the guest OS 111a, as in the virtual server 102a of the first embodiment.

ゲストVMM20の仮想CPU制御データ21は、ホストVMM10のホストVMM保持データ11と同様に、AMD−Vの仕様に応じてゲストVMM20のステータスを保持するホスト状態エリア222と、ユーザプログラムのステータスを格納するゲスト状態エリア221及び制御エリア226を備えたゲストVMCB22から構成される。   The virtual CPU control data 21 of the guest VMM 20 stores a host status area 222 that holds the status of the guest VMM 20 according to the specifications of the AMD-V and the status of the user program, similarly to the host VMM holding data 11 of the host VMM 10. The guest VMCB 22 includes a guest state area 221 and a control area 226.

以上のような構成により、ホストVMM10は、物理CPU104aから#VMEXITを受信すると、シャドウVMCB#0〜#n−1のゲスト状態エリア131に、ゲストVMM20のゲスト状態エリア221またはホスト状態エリア222の内容を書き込むことで、仮想サーバ102aで稼働する次世代OSに統合されたゲストVMM20と、このゲストVMM20上で稼動するユーザプログラムを切り替えることができる。   With the configuration described above, when the host VMM 10 receives #VMEXIT from the physical CPU 104a, the contents of the guest state area 221 or the host state area 222 of the guest VMM 20 are added to the guest state area 131 of the shadow VMCBs # 0 to # n-1. Can be switched between the guest VMM 20 integrated in the next-generation OS running on the virtual server 102a and the user program running on the guest VMM 20.

次に、ホストVMM10で行われる処理について、図12を参照しながら以下に説明する。図12は、仮想サーバ102aの稼働中に物理CPU104aからの#VMEXITを受信したときにホストVMM10のCPU制御部12が行う処理の一例を示すフローチャートである。なお、この例では、#VMEXITの要因がVMRUN命令である場合を示す。   Next, processing performed in the host VMM 10 will be described below with reference to FIG. FIG. 12 is a flowchart illustrating an example of processing performed by the CPU control unit 12 of the host VMM 10 when #VMEXIT is received from the physical CPU 104a while the virtual server 102a is operating. This example shows a case where the cause of #VMEXIT is a VMRUN instruction.

まず、S61では、ホストVMM10のCPU制御部12は、#VMEXITの要因となった操作対象のゲストOS111a(以下、ゲストOSとする)に対応するホストVMM保持データ11の仮想化機能有効フラグ141を参照し、#VMEXITを発生したゲストOSがAMD−V機能を利用可能であるか否かを判定する。仮想化機能有効フラグ141が「1」であれば操作対象のゲストOSがAMD−V機能を利用可能であると判定してS62ヘ進む。一方、仮想化機能有効フラグ141が「0」であれば操作対象のゲストOSがAMD−V機能を利用しないと判定してS73へ進む。S73では前記第1実施形態の図5に示したS15と同様に、ホストVMM10が前記従来例に示した仮想マシン処理を行う。   First, in S61, the CPU control unit 12 of the host VMM 10 sets the virtualization function valid flag 141 of the host VMM holding data 11 corresponding to the operation target guest OS 111a (hereinafter referred to as a guest OS) that has caused #VMEXIT. It is determined whether or not the guest OS that has generated #VMEXIT can use the AMD-V function. If the virtualization function enable flag 141 is “1”, it is determined that the guest OS to be operated can use the AMD-V function, and the process proceeds to S62. On the other hand, if the virtualization function enable flag 141 is “0”, it is determined that the guest OS to be operated does not use the AMD-V function, and the process proceeds to S73. In S73, as in S15 shown in FIG. 5 of the first embodiment, the host VMM 10 performs the virtual machine processing shown in the conventional example.

S62では、ホストVMM10のCPU制御部12が、操作対象の仮想CPUの動作モードフラグ143を参照し、仮想CPUの動作モードがホストモード(前記第1実施形態のVMXルートモード)とゲストモード(前記第1実施形態のVMXノンルートモード)の何れであるかを判定する。動作モードフラグ143が「0」の場合には仮想CPUがホストモードであると判定してS63へ進む。一方、動作モードフラグ143が「1」の場合には、仮想CPUがゲストモードであると判定してS69へ進む。   In S62, the CPU control unit 12 of the host VMM 10 refers to the operation mode flag 143 of the virtual CPU to be operated, and the operation mode of the virtual CPU is the host mode (the VMX root mode of the first embodiment) and the guest mode (the above-mentioned The VMMX non-root mode of the first embodiment is determined. When the operation mode flag 143 is “0”, it is determined that the virtual CPU is in the host mode, and the process proceeds to S63. On the other hand, when the operation mode flag 143 is “1”, it is determined that the virtual CPU is in the guest mode, and the process proceeds to S69.

S63では、CPU制御部12が物理CPU104aから受信した#VMEXITの発生要因を特定する。この例では、ホストモードであるので、CPU制御部12は、ゲストVMM20の状態(ステータス)を格納したゲスト状態エリア131を参照し、ゲストVMM20が発行したVMRUN命令を#VMEXITの要因として特定する。   In S63, the CPU control unit 12 identifies the cause of occurrence of #VMEXIT received from the physical CPU 104a. In this example, since it is the host mode, the CPU control unit 12 refers to the guest state area 131 storing the state (status) of the guest VMM 20 and identifies the VMRUN instruction issued by the guest VMM 20 as the factor of #VMEXIT.

次に、S64ではCPU制御部12のエミュレータ122からVMRUN命令実行モジュールを実行し、操作対象の仮想CPUをゲストモードへ切り替えるのに必要な所定の処理(状態エリア選択部121の起動など)をゲストVMM20に代わってエミュレートする。   Next, in S64, the VMRUN instruction execution module is executed from the emulator 122 of the CPU control unit 12, and predetermined processing (such as activation of the state area selection unit 121) necessary for switching the virtual CPU to be operated to the guest mode is performed on the guest. Emulate on behalf of VMM20.

次に、S65ではホストVMM10のCPU制御部12は、仮想CPUの動作モードをホストモードからゲストモードへ移行させるので、操作対象の仮想CPUの動作モードフラグ143を「1」に更新する。   Next, in S65, since the CPU control unit 12 of the host VMM 10 shifts the operation mode of the virtual CPU from the host mode to the guest mode, the operation mode flag 143 of the operation target virtual CPU is updated to “1”.

そして、S66では、CPU制御部12が操作対象のゲストVMM20のゲストVMCB22からゲスト状態エリア221に格納されているユーザプログラム(ゲストOSまたはアプリケーション)のステータスを読み込む。   In S66, the CPU control unit 12 reads the status of the user program (guest OS or application) stored in the guest status area 221 from the guest VMCB 22 of the guest VMM 20 to be operated.

S67では、CPU制御部12が、上記S66で読み込んだゲスト状態エリア221の情報で操作対象のシャドウVMCB#0のゲスト状態エリア131を更新する。そして、S68でCPU制御部12は、物理CPU104a(操作対象の仮想CPU108a)に対してVMRUN命令を発行する。   In S67, the CPU control unit 12 updates the guest status area 131 of the operation target shadow VMCB # 0 with the information of the guest status area 221 read in S66. In step S68, the CPU control unit 12 issues a VMRUN command to the physical CPU 104a (virtual CPU 108a to be operated).

VMRUN命令を受け付けた物理CPU104aは、ポインタ115で指定されたシャドウVMCBのゲスト状態エリア131の内容に基づいて、操作対象の仮想サーバのユーザプログラム(ゲストOSまたはアプリケーション)を実行する。なお、物理CPU104aは、VMRUN命令を受け付けると、ホストVMM10のステータスをホストVMM保持データ11のホスト状態エリア132へ格納し、次回の呼び出しに備える。   The physical CPU 104a that has received the VMRUN command executes the user program (guest OS or application) of the virtual server to be operated based on the contents of the guest status area 131 of the shadow VMCB designated by the pointer 115. When the physical CPU 104a receives the VMRUN command, the physical CPU 104a stores the status of the host VMM 10 in the host status area 132 of the host VMM holding data 11 and prepares for the next call.

一方、上記S62で動作モードフラグ143が「1」と判定されたゲストモードの場合は、操作対象の仮想CPUがユーザプログラムを実行中であるので、S69の処理を行う。S69では、CPU制御部12がEXITCODEを取得して、図11に示した#VMEXITの要因リストを参照し、操作対象の仮想サーバでユーザプログラムを実行中であるので、通知条件1374からゲストVMMへの#VMEXIT通知条件を検索する。この例では、#VMEXITの要因はVMRUN命令が、#VMEXIT通知条件に一致する。そして、S70ではCPU制御部12がエミュレータ122から図9の#VMEXIT条件検出モジュールを実行し、操作対象の仮想CPUをホストモードへ切り替えるのに必要な所定の処理(状態エリア選択部121の起動など)をユーザプログラムに代わってエミュレートする。   On the other hand, in the guest mode in which the operation mode flag 143 is determined to be “1” in S62, the operation target virtual CPU is executing the user program, so the process of S69 is performed. In S69, the CPU control unit 12 acquires EXITCODE, refers to the #VMEXIT factor list shown in FIG. 11, and the user program is being executed on the operation target virtual server, so the notification condition 1374 to the guest VMM Search for #VMEXIT notification condition. In this example, the cause of #VMEXIT is that the VMRUN instruction matches the #VMEXIT notification condition. In S70, the CPU control unit 12 executes the #VMEXIT condition detection module in FIG. 9 from the emulator 122, and performs predetermined processing (such as activation of the state area selection unit 121) required to switch the virtual CPU to be operated to the host mode. ) On behalf of the user program.

次に、S71ではCPU制御部12が、操作対象の仮想CPUの動作モードをゲストモードからホストモードへ移行させるので、操作対象の仮想CPUの動作モードフラグ143を「0」にリセットする。   Next, in S71, the CPU control unit 12 shifts the operation mode of the operation target virtual CPU from the guest mode to the host mode, so the operation mode flag 143 of the operation target virtual CPU is reset to “0”.

そして、S72では、CPU制御部12が操作対象のゲストVMM20から仮想CPU制御データ21のホスト状態エリア221に格納されているゲストVMM20のステータスを読み込む。   In S <b> 72, the CPU control unit 12 reads the status of the guest VMM 20 stored in the host status area 221 of the virtual CPU control data 21 from the operation target guest VMM 20.

S72の処理が完了すると、上記S67〜S68を実行し、CPU制御部12は、上記S72で読み込んだホスト状態エリア222の情報で操作対象のシャドウVMCBのゲスト状態エリア131を更新し、物理CPU104a(操作対象の仮想CPU108a)に対してVMRUN命令を発行する。この結果、VMRUN命令を受け付けた物理CPU104aは、ポインタ115で指定されたシャドウVMCBのゲスト状態エリア131の内容に基づいて、操作対象の仮想サーバのゲストVMM20を実行する。   When the processing of S72 is completed, S67 to S68 are executed, and the CPU control unit 12 updates the guest status area 131 of the shadow VMCB to be operated with the information of the host status area 222 read in S72, and the physical CPU 104a ( A VMRUN command is issued to the virtual CPU 108a to be operated. As a result, the physical CPU 104a that has received the VMRUN command executes the guest VMM 20 of the virtual server to be operated based on the contents of the guest status area 131 of the shadow VMCB designated by the pointer 115.

このように、仮想サーバで稼働するゲストOSが仮想化機能を統合した次世代OSである場合、ホストVMM10は、仮想CPUの動作モードと、発生した#VMEXITの要因に応じてシャドウVMCBのゲスト状態エリア131に書き込むステータスを、ゲストVMMまたはユーザプログラムの何れか一方から選択する。そして、ホストVMM10が物理CPU104aに対してVMRUN命令を発行することで、仮想サーバ上で第1の仮想CPU上で稼動するゲストVMMと、このゲストVMMが提供する第2の仮想CPU上で稼動するユーザプログラムを切り替えて実行することが可能となり、ゲストVMMは仮想サーバ上で仮想化環境を提供することができる。   As described above, when the guest OS running on the virtual server is a next-generation OS that integrates the virtualization function, the host VMM 10 determines the guest state of the shadow VMCB in accordance with the operation mode of the virtual CPU and the generated #VMEXIT factor. The status to be written in the area 131 is selected from either the guest VMM or the user program. When the host VMM 10 issues a VMRUN instruction to the physical CPU 104a, it operates on the guest VMM operating on the first virtual CPU on the virtual server and on the second virtual CPU provided by the guest VMM. The user program can be switched and executed, and the guest VMM can provide a virtual environment on the virtual server.

なお、上記S61の判定でゲストOSが仮想化機能を利用しない場合は、S15において、前記従来例に示した特許文献1または非特許文献1の記載に準じた仮想マシン処理をホストVMM10で行えばよい。   If the guest OS does not use the virtualization function in the determination of S61, the virtual machine processing according to the description in Patent Document 1 or Non-Patent Document 1 shown in the conventional example is performed in the host VMM 10 in S15. Good.

S73の仮想マシン処理は、例えば、図1に示した仮想サーバ102nのゲストOS111nは既存のOSであり、このゲストOS111nまたはアプリケーション112n(ユーザプログラム110n)が特権命令などの所定の命令を実行すると、上述したように物理CPU104aは#VMEXITの発生をホストVMM10に通知する。   In the virtual machine processing in S73, for example, the guest OS 111n of the virtual server 102n illustrated in FIG. 1 is an existing OS, and when the guest OS 111n or the application 112n (user program 110n) executes a predetermined command such as a privileged command, As described above, the physical CPU 104a notifies the host VMM 10 of the occurrence of #VMEXIT.

ホストVMM10は、物理CPU104aからの#VMEXITの通知を受けると、ユーザプログラム110n(仮想CPU108n)のステータスをシャドウVMCB#n−1のゲスト状態エリア131に格納する。   Upon receiving the #VMEXIT notification from the physical CPU 104a, the host VMM 10 stores the status of the user program 110n (virtual CPU 108n) in the guest status area 131 of the shadow VMCB # n-1.

ホストVMM10は、特権命令など所定の処理が完了すると、ホストVMM10のステータスをホスト状態エリア132へ格納し、ポインタ115のアドレスにゲスト状態エリア131を設定してから、VMRUN命令を発行して、制御を仮想CPU108nに移動してユーザプログラム110nの実行を再開する。   When a predetermined process such as a privileged instruction is completed, the host VMM 10 stores the status of the host VMM 10 in the host state area 132, sets the guest state area 131 to the address of the pointer 115, and then issues a VMRUN instruction to control To the virtual CPU 108n to resume execution of the user program 110n.

このように、第2の実施形態によれば、前記第1実施形態と同様に、仮想化機能を統合した次世代OSをホストVMM10上で稼動させることが可能となる。そして、仮想化機能を統合した次世代OSと、既存のOSをひとつの物理サーバ101へ統合することが可能となって、物理サーバの数を削減してサーバの運用管理コストを削減することが可能となる。   As described above, according to the second embodiment, similarly to the first embodiment, it is possible to run the next-generation OS that integrates the virtualization function on the host VMM 10. In addition, it is possible to integrate a next-generation OS that integrates virtualization functions and an existing OS into one physical server 101, thereby reducing the number of physical servers and reducing server operation management costs. It becomes possible.

さらに、上述のように、ホストVMM10は第1の仮想CPU上で稼動するゲストVMMに対して第1の仮想CPUがAMD−V機能を提供するように見せかけることができ、仮想化ソフトウェアを統合したOSを確実に稼働させることが可能となる。また、本発明のホストVMM10によれば、前記従来例のシミュレータのように、命令列の変換などのオーバーヘッドがなく、仮想計算機の性能を低下させることなく、仮想化機能を統合したOSを仮想サーバで実行することが可能となるのである。   Further, as described above, the host VMM 10 can appear to the guest VMM running on the first virtual CPU that the first virtual CPU provides the AMD-V function, and the virtualization software is integrated. The OS can be reliably operated. In addition, according to the host VMM 10 of the present invention, unlike the conventional simulator, there is no overhead such as instruction sequence conversion, and an OS that integrates the virtualization function without reducing the performance of the virtual machine is virtual server. It is possible to execute with.

<第3実施形態>
図13は、第3の実施形態を示し、前記第1実施形態に示した物理CPU104の仮想化支援機能を、VT−x機能から前記従来例(非特許文献3)に示したIPF(Itanium Processor Family)のVT−i機能に置き換えたものである。
<Third Embodiment>
FIG. 13 shows the third embodiment, and the virtualization support function of the physical CPU 104 shown in the first embodiment is changed from the VT-x function to the IPF (Itanium Processor) shown in the conventional example (Non-Patent Document 3). (Family) VT-i function.

図13において、VT−i機能を実装した物理CPU104bでは、ゲスト(ゲストVMM20またはユーザプログラム110a)を実行中に予め設定した命令やイベントがあると仮想化例外(Virtualization Fault)を発生し、ホストVMM10に制御を移す。ホストVMM10では、仮想化例外を検知すると、予め設定された仮想化プロシジャ(PAL_VPS_RESUMEプロシジャなど)を実行(エミュレーション)し、仮想CPU108aから08nを制御するためのシャドウVPD(Virtual Processor Descriptor)を更新してから物理CPU104bへ仮想化プロシジャ(PAL_VPS_RESUMEプロシジャ)を発行し、ゲストに制御を移す。なお、PAL_VPS_RESUMEプロシジャは、PAL_VPS_RESUME_NORMALプロシジャ呼び出し、またはPAL_VPS_RESUME_HANDLERプロシジャ呼び出しの総称とする。   In FIG. 13, in the physical CPU 104b in which the VT-i function is implemented, if there is a preset command or event during execution of the guest (guest VMM 20 or user program 110a), a virtualization exception is generated and the host VMM 10 Transfer control to. When the host VMM 10 detects a virtualization exception, it executes (emulates) a preset virtualization procedure (such as PAL_VPS_RESUME procedure) and updates a shadow VPD (Virtual Processor Descriptor) for controlling the virtual CPUs 108a to 08n. Issues a virtualization procedure (PAL_VPS_RESUME procedure) to the physical CPU 104b to transfer control to the guest. Note that the PAL_VPS_RESUME procedure is a generic term for a PAL_VPS_RESUME_NORMAL procedure call or a PAL_VPS_RESUME_HANDLER procedure call.

すなわち、物理CPU104bは、前記第1実施形態のVM−exitに代わって仮想化例外を発生し、VM−entry命令に代わって仮想化プロシジャを実行することで、ホストVMM10とゲストの制御を切り替えるアーキテクチャである。詳細については前記非特許文献3に詳しいので、本アーキテクチャの詳細な説明は省略する。   That is, the physical CPU 104b generates a virtualization exception in place of the VM-exit of the first embodiment, and executes a virtualization procedure in place of the VM-entry instruction, thereby switching the control between the host VMM 10 and the guest. It is. Details are detailed in Non-Patent Document 3, and a detailed description of this architecture is omitted.

ホストVMM10のホストVMM保持データ11には、前記第1実施形態と同様の仮想化機能有効フラグ141と動作モードフラグ143に加え、仮想CPU108a〜108nのステータスを格納するアーキテクチャ状態151を含む仮想CPU制御データB150を設ける。   The host VMM holding data 11 of the host VMM 10 includes a virtual CPU control including an architecture state 151 for storing the status of the virtual CPUs 108a to 108n in addition to the virtualization function valid flag 141 and the operation mode flag 143 similar to those in the first embodiment. Data B150 is provided.

そして、物理CPU制御データ13は、VT−i機能の仕様に応じて以下の情報を格納する。物理CPU制御データ13には、仮想CPU108a〜108n毎のステータスを格納するアーキテクチャ状態1310を含むシャドウVPD#0〜#n−1と、仮想CPU108a〜108n毎に仮想化例外の発生の抑止を設定するVDC(Virtualization Disable Control)領域#0〜#n−1(1320)と、仮想CPU108a〜108nが実行する命令またはイベントのうち、物理CPU104bで仮想化例外を発生する命令またはイベントを予め定義した仮想化例外要因1330と、を備える。   The physical CPU control data 13 stores the following information according to the specification of the VT-i function. In the physical CPU control data 13, the shadow VPDs # 0 to # n-1 including the architecture state 1310 for storing the status of each of the virtual CPUs 108a to 108n and the suppression of the occurrence of the virtualization exception are set for each of the virtual CPUs 108a to 108n. VDC (Virtualization Disable Control) areas # 0 to # n-1 (1320) and virtualization that predefines instructions or events that cause a virtualization exception in the physical CPU 104b among instructions or events executed by the virtual CPUs 108a to 108n An exception factor 1330.

ホストVMM保持データ11に格納されるアーキテクチャ状態は、図14で示すようになる。すなわち、仮想CPU制御データB150のアーキテクチャ状態151には、仮想CPU108a〜108nが実行するゲスト(ゲストVMM20またはユーザプログラム)のステータスが格納され、シャドウVPDのアーキテクチャ状態1310には、物理CPU104bで実行されるゲストまたはホストVMM10のステータスが格納される。   The architecture state stored in the host VMM holding data 11 is as shown in FIG. That is, the status of the guest (guest VMM 20 or user program) executed by the virtual CPUs 108a to 108n is stored in the architectural state 151 of the virtual CPU control data B150, and the physical CPU 104b executes the architectural state 1310 of the shadow VPD. The status of the guest or host VMM 10 is stored.

また、ホストVMM保持データ11の物理CPU制御データ13に格納される仮想化例外要因1330は、例えば、図15の仮想化例外要因リストで示すように設定される。図15において、仮想化例外要因リストには、仮想化例外の要因を示すコード1331と、コードに対応する仮想化例外の内容1332と、制御をゲストへ移すためのPAL_VPS_RESUMEプロシジャの呼び出し設定1333と、ゲストVMM20への仮想化例外の通知設定1334から構成される。設定1333では、図中「○」が設定された命令のときに、制御をゲストへ移すPAL_VPS_RESUMEプロシジャを呼び出すことを意味する。また、通知設定1334は、図中「○」が設定された命令のときに、ゲストVMM20へ通知を行うことを意味し、ゲストVMM20のVDC領域2202が仮想化例外の発生を抑止していないときにゲストVMM20への通知を行うことを意味する。   Further, the virtualization exception factor 1330 stored in the physical CPU control data 13 of the host VMM holding data 11 is set, for example, as shown in the virtualization exception factor list of FIG. In FIG. 15, the virtualization exception factor list includes a code 1331 indicating a factor of a virtualization exception, a virtualization exception content 1332 corresponding to the code, a call setting 1333 of a PAL_VPS_RESUME procedure for transferring control to a guest, This is composed of a virtualization exception notification setting 1334 to the guest VMM 20. The setting 1333 means that a PAL_VPS_RESUME procedure for transferring control to a guest is called when an instruction with “◯” in the figure is set. In addition, the notification setting 1334 means that notification is given to the guest VMM 20 when an instruction is set with “◯” in the figure, and the VDC area 2202 of the guest VMM 20 does not suppress the occurrence of a virtualization exception. Is notified to the guest VMM 20.

ゲストVMM20が保持する仮想CPU108aの状態は、仮想CPU制御データA210に格納される。仮想CPU制御データA210は、仮想CPU108aのステータスを格納するアーキテクチャ状態2210を含むゲストVPD220と、ゲストOSまたはアプリケーションが実行した命令またはイベントのうち、仮想CPU108aで仮想化例外を発生する命令またはイベントを定義した仮想化例外要因2201と、ゲストVMM20を実行する仮想CPU108aがVT−i機能を利用するか否かを示すVDC領域2202とを含む。   The state of the virtual CPU 108a held by the guest VMM 20 is stored in the virtual CPU control data A210. The virtual CPU control data A210 defines a command or event that causes a virtualization exception in the virtual CPU 108a among the commands or events executed by the guest OS or application and the guest VPD 220 including the architecture state 2210 for storing the status of the virtual CPU 108a. Virtualization exception factor 2201 and a VDC region 2202 indicating whether or not the virtual CPU 108a executing the guest VMM 20 uses the VT-i function.

CPU制御部12は、物理CPU104bからの仮想化例外を検知し、エミュレータ122へ通知する仮想化例外ハンドラ1240と、物理CPU104bが提供するPAL(Processor Abstraction Layer)で仮想化例外となった処理を実行させるエミュレータ122と、仮想CPU108aの稼働状態基づいて、ゲストVPDのアーキテクチャ状態2210と、ホストVMM保持データ11の仮想CPU制御データB150のアーキテクチャ状態151の何れかを選択する状態エリア選択部121と、状態エリア選択部121で選択された情報でシャドウVPDのアーキテクチャ状態1310を更新するシャドウVPD更新部1250と、ホストVMM10からゲストVMM20またはゲストVMM20上の第2の仮想CPU208a上で稼動するユーザプログラムへ制御を切り替えるため、物理CPU104bへ所定のプロシジャの実行を指令する仮想化プロシジャ指令部1250と、を備える。   The CPU control unit 12 detects a virtualization exception from the physical CPU 104b, and executes a virtualization exception handler 1240 that notifies the emulator 122 and a process that has become a virtualization exception in the PAL (Processor Abstraction Layer) provided by the physical CPU 104b. The state area selection unit 121 for selecting either the architecture state 2210 of the guest VPD or the architecture state 151 of the virtual CPU control data B150 of the host VMM holding data 11 based on the operating state of the emulator 122 and the virtual CPU 108a It operates on the guest VMM 20 from the host VMM 10 or the second virtual CPU 208a on the guest VMM 20 from the host VMM 10 and updates the shadow VPD architecture state 1310 with the information selected by the area selector 121. To switch the control to the chromatography The program includes a virtualization procedure instruction unit 1250 instructs the execution of a predetermined procedure to the physical CPU 104b, a.

次に、ホストVMM10のCPU制御部12で行われる処理の一例について、図16のフローチャートを参照しながら以下に説明する。なお、以下の説明では、前記第1実施形態の図1に示した仮想サーバ102aで次世代OSのゲストOS111aとアプリケーション112a及びゲストVMM20が稼働している例について説明する。   Next, an example of processing performed by the CPU control unit 12 of the host VMM 10 will be described below with reference to the flowchart of FIG. In the following description, an example in which the guest OS 111a, the application 112a, and the guest VMM 20 of the next generation OS are operating on the virtual server 102a illustrated in FIG. 1 of the first embodiment will be described.

図16は、仮想サーバ102aの稼働中に物理CPU104bからの仮想化例外を受信したときにホストVMM10のCPU制御部12が行う処理の一例を示すフローチャートである。なお、この例では、仮想化例外の要因がPAL_VPS_RESUMEプロシジャからのvmsw命令である場合を示す。   FIG. 16 is a flowchart illustrating an example of processing performed by the CPU control unit 12 of the host VMM 10 when a virtualization exception is received from the physical CPU 104b during operation of the virtual server 102a. This example shows a case where the cause of the virtualization exception is a vmsw instruction from the PAL_VPS_RESUME procedure.

まず、S81では、ホストVMM10のCPU制御部12が、仮想化例外の要因となった操作対象のゲストOS111a(以下、ゲストOSとする)に対応するホストVMM保持データ11の仮想化機能有効フラグ141を参照し、仮想化例外を発生したゲストOSがVT−i機能を利用可能であるか否かを判定する。仮想化機能有効フラグ141が「1」であれば操作対象のゲストOSがVT−i機能を利用可能であると判定してS82ヘ進む。一方、仮想化機能有効フラグ141が「0」であれば操作対象のゲストOSがVT−i機能を利用しないと判定してS94へ進む。S94では、ホストVMM10が前記従来例の非特許文献3に示したVT−i機能を用いて仮想マシン処理を行う。   First, in S81, the CPU control unit 12 of the host VMM 10 causes the virtualization function valid flag 141 of the host VMM holding data 11 corresponding to the operation target guest OS 111a (hereinafter referred to as the guest OS) that has caused the virtualization exception. The guest OS that has generated the virtualization exception determines whether the VT-i function can be used. If the virtualization function valid flag 141 is “1”, it is determined that the operation target guest OS can use the VT-i function, and the process proceeds to S82. On the other hand, if the virtualization function enable flag 141 is “0”, it is determined that the guest OS to be operated does not use the VT-i function, and the process proceeds to S94. In S94, the host VMM 10 performs virtual machine processing using the VT-i function shown in Non-Patent Document 3 of the conventional example.

S82では、ホストVMM10のCPU制御部12が、操作対象の仮想CPUの動作モードフラグ143を参照し、仮想CPUの動作モードがホストモード(前記第1実施形態のVMXルートモード)とゲストモード(前記第1実施形態のVMXノンルートモード)の何れであるかを判定する。動作モードフラグ143が「0」の場合には仮想CPUがゲストVMM20を実行するホストモードであると判定してS83へ進む。一方、動作モードフラグ143が「1」の場合には、仮想CPUがユーザプログラムを実行するゲストモードであると判定してS90へ進む。   In S82, the CPU control unit 12 of the host VMM 10 refers to the operation mode flag 143 of the virtual CPU to be operated, and the operation mode of the virtual CPU is the host mode (the VMX root mode of the first embodiment) and the guest mode (the above-mentioned The VMMX non-root mode of the first embodiment is determined. When the operation mode flag 143 is “0”, it is determined that the virtual CPU is in the host mode for executing the guest VMM 20, and the process proceeds to S83. On the other hand, when the operation mode flag 143 is “1”, it is determined that the virtual CPU is in the guest mode for executing the user program, and the process proceeds to S90.

S83では、CPU制御部12が物理CPU104bから受信した仮想化例外の発生要因を特定する。この例では、ホストモードであるので、CPU制御部12は、ゲストVMM20の状態(ステータス)を格納したホストVMM保持データ11内の仮想CPU制御データB150のアーキテクチャ状態151を参照し、ゲストVMM20がPAL_VPS_RESUMEプロシジャから発行したvmsw命令を仮想化例外の要因として特定する。   In S83, the CPU control unit 12 specifies the cause of occurrence of the virtualization exception received from the physical CPU 104b. In this example, since the host mode is set, the CPU control unit 12 refers to the architecture state 151 of the virtual CPU control data B150 in the host VMM holding data 11 in which the state (status) of the guest VMM 20 is stored, and the guest VMM 20 is PAL_VPS_RESUME. The vmsw instruction issued from the procedure is specified as the cause of the virtualization exception.

次に、S84ではCPU制御部12が、仮想化例外の要因となったPAL_VPS_RESUMEプロシジャモジュールを実行し、所定の処理をゲストVMM20に代わって実行し、操作対象の仮想CPUをゲストモードへ切り替えるのに必要な所定の処理(状態エリア選択部121の起動など)を実行する。   Next, in S84, the CPU control unit 12 executes the PAL_VPS_RESUME procedure module that caused the virtualization exception, executes predetermined processing on behalf of the guest VMM 20, and switches the operation target virtual CPU to the guest mode. Necessary predetermined processing (such as activation of the state area selection unit 121) is executed.

次に、S85ではCPU制御部12が、仮想CPUの動作モードをホストモードからゲストモードへ移行させるので、操作対象の仮想CPUの動作モードフラグ143を「1」に更新する。   Next, in S85, since the CPU control unit 12 shifts the operation mode of the virtual CPU from the host mode to the guest mode, the operation mode flag 143 of the operation target virtual CPU is updated to “1”.

そして、S86では、CPU制御部12が操作対象のゲストVMM20の仮想CPU制御データA210内のゲストVPD220からアーキテクチャ状態2210に格納されているユーザプログラム(ゲストOSまたはアプリケーション)のステータスを読み込む。   In S86, the CPU control unit 12 reads the status of the user program (guest OS or application) stored in the architecture state 2210 from the guest VPD 220 in the virtual CPU control data A210 of the guest VMM 20 to be operated.

S87では、CPU制御部12が物理CPU104bに対してPAL_VPS_SAVE/RESTOREプロシジャを発行し、仮想化例外の発行要因となったシャドウVPD#0を選択する。   In S87, the CPU control unit 12 issues a PAL_VPS_SAVE / RESTORE procedure to the physical CPU 104b, and selects the shadow VPD # 0 that has caused the virtualization exception.

次に、S88では、CPU制御部12が、上記S86で読み込んだアーキテクチャ状態2210のステータスを、上記S87で選択した操作対象のシャドウVPD#0のアーキテクチャ状態1310に書き込んで更新する。そして、S88においてCPU制御部12は、物理CPU104bに対してPAL_VPS_RESUMEプロシジャを発行する。   Next, in S88, the CPU control unit 12 writes and updates the status of the architecture state 2210 read in S86 in the architecture state 1310 of the operation target shadow VPD # 0 selected in S87. In step S88, the CPU control unit 12 issues a PAL_VPS_RESUME procedure to the physical CPU 104b.

PAL_VPS_RESUMEプロシジャを受け付けた物理CPU104bは、S87で選択されたシャドウVPDのアーキテクチャ状態1310の内容に基づいて、操作対象の仮想サーバのユーザプログラム(ゲストOSまたはアプリケーション)を実行する。   The physical CPU 104b that has received the PAL_VPS_RESUME procedure executes the user program (guest OS or application) of the operation target virtual server based on the contents of the architecture state 1310 of the shadow VPD selected in S87.

一方、上記S82で動作モードフラグ143が「1」と判定されたゲストモードの場合は、操作対象の仮想CPUがユーザプログラムを実行中であるので、S90の処理を行う。S90では、CPU制御部12が仮想化例外の要因を取得して、図15に示した仮想化例外の要因リストを参照し、通知条件1334からゲストVMMへの仮想化例外通知条件を検索する。この例では、仮想化例外の要因がvmsw命令であるので、仮想化例外通知条件はゲストVMM20のVDC領域2202の設定によるものとなる。ここでは、ゲストVMM20へ仮想化例外を通知するものとして扱う。そして、S91では図13の仮想化例外条件検出モジュールを実行し、操作対象の仮想CPUをホストモードへ切り替えるのに必要な所定の処理(状態エリア選択部121の起動など)をゲストVMM20に代わってエミュレートする。   On the other hand, in the guest mode in which the operation mode flag 143 is determined to be “1” in S82, the operation target virtual CPU is executing the user program, so the process of S90 is performed. In S90, the CPU control unit 12 acquires a virtualization exception factor, refers to the virtualization exception factor list shown in FIG. 15, and searches for a virtualization exception notification condition from the notification condition 1334 to the guest VMM. In this example, since the cause of the virtualization exception is the vmsw instruction, the virtualization exception notification condition depends on the setting of the VDC area 2202 of the guest VMM 20. Here, it is handled as a notification of the virtualization exception to the guest VMM 20. In S91, the virtualization exception condition detection module shown in FIG. 13 is executed, and predetermined processing (such as activation of the state area selection unit 121) necessary for switching the operation target virtual CPU to the host mode is performed on behalf of the guest VMM 20. Emulate.

次に、S92ではCPU制御部12が、操作対象の仮想CPUの動作モードをゲストモードからホストモードへ移行させるので、操作対象の仮想CPUの動作モードフラグ143を「0」にリセットする。   Next, in S92, the CPU control unit 12 shifts the operation mode of the operation target virtual CPU from the guest mode to the host mode, so the operation mode flag 143 of the operation target virtual CPU is reset to “0”.

そして、S93では、CPU制御部12がホストVMM保持データ11内の操作対象の仮想CPUに対応する仮想CPU制御データB150のアーキテクチャ状態151に格納されているゲストVMM20のステータスを読み込む。   In S93, the CPU control unit 12 reads the status of the guest VMM 20 stored in the architecture state 151 of the virtual CPU control data B150 corresponding to the operation target virtual CPU in the host VMM holding data 11.

S93の処理が完了すると、上記S87〜S89を実行し、CPU制御部12は、上記S93で読み込んだホストVMM保持データ11の仮想CPU制御データB150のアーキテクチャ状態151の情報で操作対象のシャドウVPDのアーキテクチャ状態1310を更新し、物理CPU104bに対してPAL_VPS_RESUMEプロシジャを発行する。この結果、PAL_VPS_RESUMEプロシジャを受け付けた物理CPU104bは、シャドウVPD#0のアーキテクチャ状態1310の内容に基づいて、操作対象の仮想サーバのゲストVMM20を実行する。   When the processing of S93 is completed, S87 to S89 are executed, and the CPU control unit 12 uses the information of the architecture state 151 of the virtual CPU control data B150 of the host VMM holding data 11 read in S93 to determine the shadow VPD to be operated. The architecture state 1310 is updated, and a PAL_VPS_RESUME procedure is issued to the physical CPU 104b. As a result, the physical CPU 104b that has received the PAL_VPS_RESUME procedure executes the guest VMM 20 of the operation target virtual server based on the contents of the architecture state 1310 of the shadow VPD # 0.

このように、仮想サーバで稼働するゲストOSが仮想化機能を統合した次世代OSである場合、ホストVMM10は、仮想CPUの動作モードと、発生した仮想化例外の要因に応じて、シャドウVPDのアーキテクチャ状態1310に書き込むステータスを、ゲストVMMまたはユーザプログラムの何れか一方から選択する。そして、ホストVMM10が物理CPU104bに対してPAL_VPS_RESUMEプロシジャを発行することで、仮想サーバ上でゲストVMMと、このゲストVMMが提供する第2の仮想CPU208a上で稼動するユーザプログラムを切り替えて実行することが可能となり、ゲストVMMは仮想サーバ上で仮想化環境を提供することができる。   As described above, when the guest OS running on the virtual server is a next-generation OS that integrates the virtualization function, the host VMM 10 determines the shadow VPD according to the operation mode of the virtual CPU and the cause of the generated virtualization exception. The status to be written in the architecture state 1310 is selected from either the guest VMM or the user program. When the host VMM 10 issues a PAL_VPS_RESUME procedure to the physical CPU 104b, the guest VMM on the virtual server and the user program running on the second virtual CPU 208a provided by the guest VMM can be switched and executed. The guest VMM can provide a virtual environment on the virtual server.

なお、上記S81の判定でゲストOSが仮想化機能を利用しない場合は、S94において、前記従来例に示した特許文献1または非特許文献3の記載に準じた仮想マシン処理をホストVMM10で行えばよい。   If the guest OS does not use the virtualization function in the determination of S81, the virtual machine process according to the description in Patent Document 1 or Non-Patent Document 3 shown in the conventional example is performed in the host VMM 10 in S94. Good.

S94の仮想マシン処理は、例えば、図1に示した仮想サーバ102nのゲストOS111nは既存のOSであり、このゲストOS111nまたはアプリケーション112n(ユーザプログラム110n)が仮想化例外要因の命令を実行すると、上述したように物理CPU104bは仮想化例外の発生をホストVMM10に通知する。   In the virtual machine processing in S94, for example, when the guest OS 111n of the virtual server 102n illustrated in FIG. 1 is an existing OS, and the guest OS 111n or the application 112n (user program 110n) executes a virtualization exception factor instruction, the virtual OS 102n illustrated in FIG. As described above, the physical CPU 104b notifies the host VMM 10 of the occurrence of the virtualization exception.

ホストVMM10は、物理CPU104bからの仮想化例外の通知を受けると、ユーザプログラム110n(仮想CPU108n)のステータスを仮想CPU制御データB150のアーキテクチャ状態151に格納する。   Upon receiving the notification of the virtualization exception from the physical CPU 104b, the host VMM 10 stores the status of the user program 110n (virtual CPU 108n) in the architecture state 151 of the virtual CPU control data B150.

ホストVMM10は、仮想化例外の要因となった命令をエミュレートした後、PAL_VPS_RESUMEプロシジャを発行して、制御を仮想CPU108nに移動してユーザプログラム110nの実行を再開する。   After emulating the instruction that caused the virtualization exception, the host VMM 10 issues a PAL_VPS_RESUME procedure, transfers control to the virtual CPU 108n, and resumes execution of the user program 110n.

このように、第3の実施形態によれば、前記第1実施形態と同様に、仮想化機能を統合した次世代OSと、既存のOSをひとつの物理サーバ101へ統合することが可能となって、物理サーバの数を削減してサーバの運用管理コストを削減することが可能となる。   As described above, according to the third embodiment, similarly to the first embodiment, it is possible to integrate a next-generation OS that integrates virtualization functions and an existing OS into one physical server 101. Thus, the number of physical servers can be reduced to reduce the server operation management cost.

さらに、上述のように、ホストVMM10は次世代OSに対して仮想CPUがVT−i機能を提供するように見せかけることができ、仮想化ソフトウェアを統合したOSを確実に稼働させることが可能となる。また、本発明のホストVMM10によれば、前記従来例のシミュレータのように、命令列の変換などのオーバーヘッドがなく、仮想計算機の性能を低下させることなく、仮想化機能を統合したOSを仮想サーバで実行することが可能となるのである。   Further, as described above, the host VMM 10 can make the virtual CPU provide the VT-i function to the next-generation OS, and can reliably operate the OS integrated with the virtualization software. . In addition, according to the host VMM 10 of the present invention, unlike the conventional simulator, there is no overhead such as instruction sequence conversion, and an OS that integrates the virtualization function without reducing the performance of the virtual machine is virtual server. It is possible to execute with.

なお、上記各実施形態において、物理CPU104、104a、104bとして記載したプロセッサは、マルチコアプロセッサの構成でも良く、また、ホモジニアスなプロセッサやヘテロジニアスのプロセッサを採用することができる。すなわち、物理CPU104、104a、104bとして複数の汎用プロセッサコア(CPU)と特定用途プロセッサコアを含むヘテロジニアス・マルチコア・プロセッサを用いる場合は、汎用プロセッサコアが仮想化支援機能を備えていれば本発明を適用することができる。   In each of the above embodiments, the processors described as the physical CPUs 104, 104a, and 104b may have a multi-core processor configuration, and a homogeneous processor or a heterogeneous processor may be employed. That is, when a heterogeneous multi-core processor including a plurality of general-purpose processor cores (CPUs) and a special-purpose processor core is used as the physical CPUs 104, 104a, and 104b, the present invention can be used if the general-purpose processor core has a virtualization support function. Can be applied.

1.
物理プロセッサとメモリを備えた物理計算機で実行されて、複数の仮想プロセッサを提供する仮想化プログラムにおいて、
第1の仮想マシンマネージャが第1の仮想プロセッサを生成する手順と、
前記第1の仮想プロセッサ上で実行される第2の仮想マシンマネージャが第2の仮想プロセッサを生成する手順と、
前記第2の仮想プロセッサがユーザプログラムを実行する手順と、
前記第1の仮想マシンマネージャが、前記物理プロセッサから当該第1の仮想マシンマネージャの呼び出しを受信する手順と、
前記第1の仮想マシンマネージャが、前記第1の仮想マシンマネージャ呼び出しの要因を解析する手順と、
前記第1の仮想マシンマネージャが、前記解析の結果に基づいて前記第2の仮想マシンマネージャと、前記ユーザプログラムのいずれを実行するかを判定する手順と、
前記第1の仮想マシンマネージャが、前記判定の結果に基づいて前記第1の仮想プロセッサに前記第2の仮想マシンマネージャまたは前記ユーザプログラムの一方を実行させる手順と、
を前記物理プロセッサに実行させることを特徴とする仮想化プログラム。
1.
In a virtualization program that is executed on a physical computer including a physical processor and a memory and provides a plurality of virtual processors,
The first virtual machine manager generating a first virtual processor;
A second virtual machine manager executing on the first virtual processor generating a second virtual processor;
A procedure in which the second virtual processor executes a user program;
The first virtual machine manager receiving a call to the first virtual machine manager from the physical processor;
A procedure in which the first virtual machine manager analyzes a factor of the first virtual machine manager call;
The first virtual machine manager determines whether to execute the second virtual machine manager or the user program based on the result of the analysis;
The first virtual machine manager causing the first virtual processor to execute one of the second virtual machine manager or the user program based on the result of the determination;
Is executed by the physical processor.

2.
前記第1の仮想マシンマネージャが、前記ユーザプログラムを実行する際の第1の仮想プロセッサの状態を規定する第1の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャを実行する際の前記第1の仮想プロセッサの状態を規定する第2の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャまたは前記ユーザプログラムを実行する際の前記物理プロセッサの状態を規定する第3の制御情報を前記メモリに設定する手順と、
をさらに含み、
前記第1の仮想マシンマネージャが、判定の結果に基づいて前記第1の仮想プロセッサに前記第2の仮想マシンマネージャまたは前記ユーザプログラムの一方を実行させる手順は、
前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに前記ユーザプログラムの実行を開始させるときには、前記第1の制御情報を参照する手順と、
前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに前記第2の仮想マシンマネージャの実行を開始させるときには、前記第2の制御情報を参照する手順と、
前記第1の仮想マシンマネージャが、前記参照した前記第1の制御情報または第2の制御情報の一方で前記第3の制御情報を更新する手順と、
前記第1の仮想マシンマネージャが、前記物理プロセッサに対して前記第3の制御情報に従って命令の実行を開始するよう指示する第1の制御命令を発行する手順と、
を含むことを特徴とする上記1.に記載の仮想化プログラム。
2.
A procedure in which the first virtual machine manager sets, in the memory, first control information that defines a state of a first virtual processor when the user program is executed;
A procedure in which the first virtual machine manager sets, in the memory, second control information that defines a state of the first virtual processor when the second virtual machine manager is executed;
A procedure in which the first virtual machine manager sets, in the memory, third control information that defines a state of the physical processor when the second virtual machine manager or the user program is executed;
Further including
The first virtual machine manager causes the first virtual processor to execute one of the second virtual machine manager or the user program based on a determination result.
A step of referring to the first control information when the first virtual machine manager causes the first virtual processor to start executing the user program;
A step of referring to the second control information when the first virtual machine manager causes the first virtual processor to start execution of the second virtual machine manager;
A procedure in which the first virtual machine manager updates the third control information on one of the referenced first control information or second control information;
A procedure in which the first virtual machine manager issues a first control instruction that instructs the physical processor to start executing an instruction according to the third control information;
The above-mentioned 1. is characterized by including The virtualization program described in.

3.
前記物理プロセッサは、インテル・アーキテクチャー32の命令セットに準拠するプロセッサであって、
前記第1の仮想マシンマネージャが、前記解析の結果に基づいて前記第2の仮想マシンマネージャと、前記ユーザプログラムのいずれを実行するかを判定する手順は、
前記呼び出し要因の解析の結果が、前記第2の仮想マシンマネージャからのVM−entry命令の発行である場合に、前記ユーザプログラムの実行開始と判定し、
前記呼び出し要因の解析の結果が、前記第1の仮想プロセッサから第2の仮想マシンマネージャに対してVM−exitを通知する場合に、前記第2の仮想マシンマネージャの実行開始と判定することを特徴とする上記2.に記載の仮想化プログラム。
3.
The physical processor is a processor conforming to the instruction set of Intel Architecture 32,
The procedure in which the first virtual machine manager determines which of the second virtual machine manager and the user program to execute based on the result of the analysis is as follows:
If the result of the call factor analysis is a VM-entry instruction issued from the second virtual machine manager, it is determined that the execution of the user program is started;
When the result of the call factor analysis notifies the second virtual machine manager of the VM-exit from the first virtual processor, it is determined that the execution of the second virtual machine manager is started. 2 above. The virtualization program described in.

4.
前記物理プロセッサは、AMD64の命令セットに準拠するプロセッサであって、
前記第1の仮想マシンマネージャが、前記解析の結果に基づいて前記第2の仮想マシンマネージャと、前記ユーザプログラムのいずれを実行するかを判定する手順は、
前記呼び出し要因の解析の結果が、前記第2の仮想マシンマネージャからのVMRUN命令の発行である場合に、前記ユーザプログラムの実行開始と判定し、
前記呼び出し要因の解析の結果が、前記第1の仮想プロセッサから第2の仮想マシンマネージャに対して#VMEXITを通知する場合に、前記第2の仮想マシンマネージャの実行開始と判定することを特徴とする上記2.に記載の仮想化プログラム。
4).
The physical processor is a processor conforming to the instruction set of AMD64,
The procedure in which the first virtual machine manager determines which of the second virtual machine manager and the user program to execute based on the result of the analysis is as follows:
When the result of the call factor analysis is a VMRUN instruction issued from the second virtual machine manager, it is determined that the execution of the user program is started,
When the result of the analysis of the call factor notifies #VMEXIT from the first virtual processor to the second virtual machine manager, it is determined that the execution of the second virtual machine manager is started. 2 above. The virtualization program described in.

5.
前記物理プロセッサは、アイテニウム・プロセッサ・ファミリの命令セットに準拠するプロセッサであって、
前記第1の仮想マシンマネージャが、前記解析の結果に基づいて前記第2の仮想マシンマネージャと、前記ユーザプログラムのいずれを実行するかを判定する手順は、
前記呼び出し要因の解析の結果が、前記第2の仮想マシンマネージャからのPAL_VPS_RESUME_HANDLERプロシジャ呼び出しの発行である場合に、前記ユーザプログラムの実行開始と判定し、
前記呼び出し要因の解析の結果が、前記第1の仮想プロセッサから第2の仮想マシンマネージャに対して仮想化例外を通知する場合に、前記第2の仮想マシンマネージャの実行開始と判定することを特徴とする上記2.に記載の仮想化プログラム。
5.
The physical processor is a processor conforming to the instruction set of the Itanium processor family,
The procedure in which the first virtual machine manager determines which of the second virtual machine manager and the user program to execute based on the result of the analysis is as follows:
If the result of the call factor analysis is an issuance of a PAL_VPS_RESUME_HANDLER procedure call from the second virtual machine manager, it is determined that the execution of the user program is started;
When the result of the analysis of the call factor notifies the second virtual machine manager of a virtualization exception from the first virtual processor, it is determined that the execution of the second virtual machine manager is started. 2 above. The virtualization program described in.

6.
前記第1の仮想マシンマネージャが第1の仮想プロセッサを生成する手順は、
前記第1の仮想プロセッサを複数生成する手順を含み、
前記物理プロセッサの状態を規定する第3の制御情報を前記メモリに設定する手順は、
前記第1の仮想プロセッサ毎に、前記第3の制御情報をそれぞれ前記メモリに設定する手順を含み、
前記第1の仮想マシンマネージャが、前記物理プロセッサに対して前記第3の制御情報に従って命令の実行を開始するよう指示する第1の制御命令を発行する手順は、
前記複数の第3の制御情報のうちの一つを選択する第2の制御命令を発行する手順を含むことを特徴とする上記2.に記載の仮想化プログラム。
6).
The first virtual machine manager generates a first virtual processor by:
Including a step of generating a plurality of the first virtual processors,
The procedure for setting the third control information defining the state of the physical processor in the memory is as follows:
Including a procedure for setting the third control information in the memory for each of the first virtual processors,
The first virtual machine manager issues a first control instruction that instructs the physical processor to start executing an instruction according to the third control information.
2. A procedure for issuing a second control command for selecting one of the plurality of third control information. The virtualization program described in.

7.
前記第2の仮想マシンマネージャが、前記第1の仮想プロセッサで前記第1の制御命令を受付可能か否かを確認する第3の制御命令を発行する手順をさらに含み、
前記第1の仮想マシンマネージャが、前記第1の仮想マシンマネージャ呼び出しの要因を解析する手順は、
前記第1の仮想マシンマネージャ呼び出しの要因が、前記第2の仮想マシンマネージャからの前記第3の制御命令であるときに、予め設定された応答可否情報を参照する手順と、
前記応答可否情報に応じて、前記第3の制御命令に対する応答を決定する手順と、
を含むことを特徴とする上記2.に記載の仮想化プログラム。
7).
The second virtual machine manager further includes a step of issuing a third control instruction for confirming whether or not the first virtual processor can accept the first control instruction.
The first virtual machine manager analyzes the cause of the first virtual machine manager call.
A step of referring to response availability information set in advance when the cause of the first virtual machine manager call is the third control command from the second virtual machine manager;
Determining a response to the third control command according to the response availability information;
The above-mentioned 2. characterized by including The virtualization program described in.

8.
前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに対する設定要求を受信する手順と、
前記第1の仮想マシンマネージャは、前記設定要求に基づいて前記応答可否情報を設定する手順と、
をさらに含むことを特徴とする上記7.に記載の仮想化プログラム。
8).
A procedure in which the first virtual machine manager receives a setting request for the first virtual processor;
The first virtual machine manager sets the response availability information based on the setting request;
The above-mentioned 7. The virtualization program described in.

9.
前記物理プロセッサは、インテル・アーキテクチャー32の命令セットに準拠するプロセッサであって、
前記第3の制御命令は、CPUID命令であることを特徴とする上記7.に記載の仮想化プログラム。
9.
The physical processor is a processor conforming to the instruction set of Intel Architecture 32,
6. The seventh control instruction is a CPUID instruction. The virtualization program described in.

10.
前記第2の仮想マシンマネージャが、前記第1の仮想マシンマネージャから前記第3の制御命令に対する応答を受信する手順と、
前記第2の仮想マシンマネージャが、前記第1の制御命令が前記第1の仮想プロセッサにて受付可能である場合に、前記第1の仮想プロセッサに対して前記第1の制御命令を受付可能に設定する命令を発行する手順と、
を含むことを特徴とする上記9.に記載の仮想化プログラム。
10.
The second virtual machine manager receiving a response to the third control command from the first virtual machine manager;
The second virtual machine manager can accept the first control instruction to the first virtual processor when the first control instruction can be accepted by the first virtual processor. A procedure for issuing instructions to be set;
The above-mentioned 9. characterized by including The virtualization program described in.

11.
前記第1の仮想マシンマネージャが、前記ユーザプログラムを実行する際の第1の仮想プロセッサの状態を規定する第1の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャを実行する際の前記第1の仮想プロセッサの状態を規定する第2の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャまたは前記ユーザプログラムを実行する際の前記物理プロセッサの状態を規定する第3の制御情報を前記メモリに設定する手順と、
をさらに含み、
前記第1の仮想マシンマネージャが、前記解析の結果に基づいて前記第2の仮想マシンマネージャと、前記ユーザプログラムのいずれを実行するかを判定する手順は、
前記解析の結果が、前記第2の仮想マシンマネージャから前記第1の制御情報に対して前記第1の仮想プロセッサの動作状態を反映させる第4の制御命令を第1の仮想マシンマネージャ呼び出しの要因のときに、
前記第1の仮想マシンマネージャが前記物理プロセッサに対して、前記第3の制御情報に前記物理プロセッサの動作状態を反映させる第4の制御命令を発行し、
前記第1の仮想マシンマネージャが前記物理プロセッサの動作状態を反映した前記第3の制御情報を参照し、
前記第1の仮想マシンマネージャが、前記参照した第3の制御情報に基づいて、前記第1の制御情報を更新した後に、前記第2の仮想マシンマネージャの実行を判定することを特徴とする上記1.に記載の仮想化プログラム。
11.
A procedure in which the first virtual machine manager sets, in the memory, first control information that defines a state of a first virtual processor when the user program is executed;
A procedure in which the first virtual machine manager sets, in the memory, second control information that defines a state of the first virtual processor when the second virtual machine manager is executed;
A procedure in which the first virtual machine manager sets, in the memory, third control information that defines a state of the physical processor when the second virtual machine manager or the user program is executed;
Further including
The procedure in which the first virtual machine manager determines which of the second virtual machine manager and the user program to execute based on the result of the analysis is as follows:
As a result of the analysis, a factor causing the first virtual machine manager to call a fourth control instruction reflecting the operation state of the first virtual processor with respect to the first control information from the second virtual machine manager. When
The first virtual machine manager issues a fourth control instruction for reflecting the operation state of the physical processor in the third control information to the physical processor;
The first virtual machine manager refers to the third control information reflecting the operating state of the physical processor;
The first virtual machine manager determines execution of the second virtual machine manager after updating the first control information based on the referenced third control information. 1. The virtualization program described in.

12.
前記物理プロセッサは、インテル・アーキテクチャー32の命令セットに準拠するプロセッサであって、
前記第4の制御命令がVMCLEAR命令であることを特徴とする上記11.に記載の仮想化プログラム。
12
The physical processor is a processor conforming to the instruction set of Intel Architecture 32,
10. The fourth control instruction is a VMCLEAR instruction. The virtualization program described in.

13.
物理プロセッサとメモリを備えた物理計算機上で複数の仮想プロセッサを提供する仮想計算機システムにおいて、
前記物理プロセッサ上で動作して、第1の仮想プロセッサを提供する第1の仮想マシンマネージャと、
前記第1の仮想プロセッサ上で動作して、ユーザプログラムを実行する第2の仮想プロセッサを提供する第2の仮想マシンマネージャと、を備え、
前記第2の仮想マシンマネージャは、
前記ユーザプログラムを実行する際の第1の仮想プロセッサの状態を規定する第1の制御情報と、前記第2の仮想マシンマネージャを実行する際の前記第1の仮想プロセッサの状態を規定する第2の制御情報とを格納する仮想プロセッサ制御データを有し、
前記第1の仮想マシンマネージャは、
前記第2の仮想マシンマネージャまたは前記ユーザプログラムを実行する際の前記物理プロセッサの状態を規定する第3の制御情報を前記メモリに格納する物理プロセッサ制御データと、
前記物理プロセッサから当該第1の仮想マシンマネージャの呼び出しを受信する受信部と、
前記第1の仮想マシンマネージャ呼び出しの要因を解析し、前記第2の仮想マシンマネージャと、前記ユーザプログラムのいずれを実行するかを判定する判定部と、
前記判定の結果に基づいて、前記仮想プロセッサ制御データの第1の制御情報と第2の制御情報の何れかを選択する選択部と、
前記選択された第1の制御情報または第2の制御情報で、前記物理プロセッサ制御データの第3の制御情報を更新する更新部と、
前記第3の制御情報に基づいて、前記第1の仮想プロセッサに前記第2の仮想マシンマネージャまたは前記ユーザプログラムの一方を実行させる命令を発行する命令発行部と、
を有することを特徴とする仮想計算機システム。
13.
In a virtual computer system that provides a plurality of virtual processors on a physical computer having a physical processor and a memory,
A first virtual machine manager operating on the physical processor and providing a first virtual processor;
A second virtual machine manager that operates on the first virtual processor and provides a second virtual processor that executes a user program;
The second virtual machine manager is
First control information that defines the state of the first virtual processor when executing the user program, and second that defines the state of the first virtual processor when executing the second virtual machine manager Virtual processor control data for storing control information of
The first virtual machine manager is
Physical processor control data for storing, in the memory, third control information that defines a state of the physical processor when executing the second virtual machine manager or the user program;
A receiving unit for receiving a call to the first virtual machine manager from the physical processor;
Analyzing a factor of the first virtual machine manager invocation and determining which of the second virtual machine manager and the user program to execute;
A selection unit that selects one of the first control information and the second control information of the virtual processor control data based on the determination result;
An update unit for updating the third control information of the physical processor control data with the selected first control information or second control information;
An instruction issuing unit for issuing an instruction for causing the first virtual processor to execute one of the second virtual machine manager or the user program based on the third control information;
A virtual computer system characterized by comprising:

14.
前記物理プロセッサは、インテル・アーキテクチャー32の命令セットに準拠するプロセッサであって、
前記判定部は、
前記第1の仮想マシンマネージャの呼び出し要因の解析の結果が、前記第2の仮想マシンマネージャからのVM−entry命令の発行である場合に、前記ユーザプログラムの実行開始と判定し、
前記第1の仮想マシンマネージャの呼び出し要因の解析の結果が、前記第1の仮想プロセッサから第2の仮想マシンマネージャに対してVM−exitを通知する場合に、前記第2の仮想マシンマネージャの実行開始と判定することを特徴とする上記13.に記載の仮想計算機システム。
14
The physical processor is a processor conforming to the instruction set of Intel Architecture 32,
The determination unit
When the result of analyzing the call factor of the first virtual machine manager is the issue of a VM-entry instruction from the second virtual machine manager, it is determined that the execution of the user program is started,
Execution of the second virtual machine manager when the result of analyzing the call cause of the first virtual machine manager notifies the second virtual machine manager of the VM-exit from the first virtual processor 13. The above-described 13., characterized in that the start is determined. The virtual computer system described in 1.

15.
前記物理プロセッサは、AMD64の命令セットに準拠するプロセッサであって、
前記判定部は、
前記第1の仮想マシンマネージャの呼び出し要因の解析の結果が、前記第2の仮想マシンマネージャからのVMRUN命令の発行である場合に、前記ユーザプログラムの実行開始と判定し、
前記第1の仮想マシンマネージャの呼び出し要因の解析の結果が、前記第1の仮想プロセッサから第2の仮想マシンマネージャに対して#VMEXITを通知する場合に、前記第2の仮想マシンマネージャの実行開始と判定することを特徴とする上記13.に記載の仮想計算機システム。
15.
The physical processor is a processor conforming to the instruction set of AMD64,
The determination unit
If the result of analyzing the call factor of the first virtual machine manager is the issue of a VMRUN instruction from the second virtual machine manager, it is determined that the execution of the user program is started;
When the result of analyzing the call factor of the first virtual machine manager notifies #VMEXIT to the second virtual machine manager from the first virtual processor, execution of the second virtual machine manager starts. 13. It is determined that The virtual computer system described in 1.

16.
前記物理プロセッサは、アイテニウム・プロセッサ・ファミリの命令セットに準拠するプロセッサであって、
前記判定部は、
前記第1の仮想マシンマネージャの呼び出し要因の解析の結果が、前記第2の仮想マシンマネージャからのPAL_VPS_RESUME_HANDLERプロシジャ呼び出しの発行である場合に、前記ユーザプログラムの実行開始と判定し、
前記第1の仮想マシンマネージャの呼び出し要因の解析の結果が、前記第1の仮想プロセッサから第2の仮想マシンマネージャに対して仮想化例外を通知する場合に、前記第2の仮想マシンマネージャの実行開始と判定することを特徴とする上記13.に記載の仮想計算機システム。
16.
The physical processor is a processor conforming to the instruction set of the Itanium processor family,
The determination unit
If the result of analyzing the call factor of the first virtual machine manager is the issuance of a PAL_VPS_RESUME_HANDLER procedure call from the second virtual machine manager, it is determined that the execution of the user program is started,
Execution of the second virtual machine manager when the result of analyzing the call cause of the first virtual machine manager notifies the second virtual machine manager of a virtualization exception from the first virtual processor 13. The above-described 13., characterized in that the start is determined. The virtual computer system described in 1.

以上のように、本発明は、複数の仮想サーバを提供する仮想計算機システムに適用することができる。また、本発明は、物理計算機上で複数の仮想サーバを提供する仮想化管理(VMM)ソフトウェアに適用することができる。   As described above, the present invention can be applied to a virtual machine system that provides a plurality of virtual servers. The present invention can also be applied to virtualization management (VMM) software that provides a plurality of virtual servers on a physical computer.

10 ホストVMM
11 ホストVMM保持データ
12 CPU制御部
13 物理CPU制御データ
20 ゲストVMM
21 仮想CPU制御データ
101 物理サーバ(物理計算機)
102a〜102n 仮想サーバ
108a〜108n 仮想CPU
104 CPU
105 メモリ
110a〜110n ユーザプログラム
111a〜111n ゲストOS
112a〜112n アプリケーション
208 仮想CPU
301 ユーザーインターフェース
10 Host VMM
11 Host VMM holding data 12 CPU control unit 13 Physical CPU control data 20 Guest VMM
21 Virtual CPU control data 101 Physical server (physical computer)
102a to 102n virtual servers 108a to 108n virtual CPU
104 CPU
105 Memory 110a to 110n User program 111a to 111n Guest OS
112a to 112n Application 208 Virtual CPU
301 User interface

Claims (1)

物理プロセッサとメモリを備えた物理計算機で実行されて、複数の仮想プロセッサを提供する仮想化プログラムにおいて、
第1の仮想マシンマネージャが第1の仮想プロセッサを生成する手順と、
前記第1の仮想プロセッサ上で実行される第2の仮想マシンマネージャが第2の仮想プロセッサを生成する手順と、
前記第2の仮想プロセッサがユーザプログラムを実行する手順と、
前記第1の仮想マシンマネージャが、前記ユーザプログラムを実行する際の第1の仮想プロセッサの状態を規定する第1の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャを実行する際の前記第1の仮想プロセッサの状態を規定する第2の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第2の仮想マシンマネージャまたは前記ユーザプログラムを実行する際の前記物理プロセッサの状態を規定する第3の制御情報を前記メモリに設定する手順と、
前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに前記ユーザプログラムの実行を開始させるときには、前記第1の制御情報を参照する手順と、
前記第1の仮想マシンマネージャが、前記第1の仮想プロセッサに前記第2の仮想マシンマネージャの実行を開始させるときには、前記第2の制御情報を参照する手順と、
前記第1の仮想マシンマネージャが、前記参照した前記第1の制御情報または第2の制御情報の一方で前記第3の制御情報を更新する手順と、
前記第1の仮想マシンマネージャが、前記物理プロセッサに対して前記第3の制御情報に従って命令の実行を開始するよう指示する第1の制御命令を発行する手順と、
を前記物理プロセッサに実行させることを特徴とする仮想化プログラム。
In a virtualization program that is executed on a physical computer including a physical processor and a memory and provides a plurality of virtual processors,
The first virtual machine manager generating a first virtual processor;
A second virtual machine manager executing on the first virtual processor generating a second virtual processor;
A procedure in which the second virtual processor executes a user program;
A procedure in which the first virtual machine manager sets, in the memory, first control information that defines a state of a first virtual processor when the user program is executed;
A procedure in which the first virtual machine manager sets, in the memory, second control information that defines a state of the first virtual processor when the second virtual machine manager is executed;
A procedure in which the first virtual machine manager sets, in the memory, third control information that defines a state of the physical processor when the second virtual machine manager or the user program is executed;
A step of referring to the first control information when the first virtual machine manager causes the first virtual processor to start executing the user program;
A step of referring to the second control information when the first virtual machine manager causes the first virtual processor to start execution of the second virtual machine manager;
A procedure in which the first virtual machine manager updates the third control information on one of the referenced first control information or second control information;
A procedure in which the first virtual machine manager issues a first control instruction that instructs the physical processor to start executing an instruction according to the third control information;
Is executed by the physical processor.
JP2011245409A 2011-11-09 2011-11-09 Virtualization program Expired - Fee Related JP5369356B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011245409A JP5369356B2 (en) 2011-11-09 2011-11-09 Virtualization program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011245409A JP5369356B2 (en) 2011-11-09 2011-11-09 Virtualization program

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2007164892A Division JP4864817B2 (en) 2007-06-22 2007-06-22 Virtualization program and virtual computer system

Related Child Applications (1)

Application Number Title Priority Date Filing Date
JP2013158534A Division JP5608797B2 (en) 2013-07-31 2013-07-31 Virtualization program, virtual computer system, and computer system control method

Publications (3)

Publication Number Publication Date
JP2012027960A true JP2012027960A (en) 2012-02-09
JP2012027960A5 JP2012027960A5 (en) 2012-03-22
JP5369356B2 JP5369356B2 (en) 2013-12-18

Family

ID=45780718

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011245409A Expired - Fee Related JP5369356B2 (en) 2011-11-09 2011-11-09 Virtualization program

Country Status (1)

Country Link
JP (1) JP5369356B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10162657B2 (en) 2013-04-22 2018-12-25 Fujitsu Limited Device and method for address translation setting in nested virtualization environment

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099332A (en) * 2004-09-29 2006-04-13 Sony Corp Information processor, process control method and computer program
WO2007005819A1 (en) * 2005-06-30 2007-01-11 Intel Corporation System and method to optimize os context switching by instruction group trapping
JP2007035045A (en) * 2005-07-27 2007-02-08 Intel Corp Virtualization event processing in layered virtualization architecture
JP2007183951A (en) * 2005-12-30 2007-07-19 Intel Corp Transmission of direct interrupt to virtual processor

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006099332A (en) * 2004-09-29 2006-04-13 Sony Corp Information processor, process control method and computer program
WO2007005819A1 (en) * 2005-06-30 2007-01-11 Intel Corporation System and method to optimize os context switching by instruction group trapping
JP2007035045A (en) * 2005-07-27 2007-02-08 Intel Corp Virtualization event processing in layered virtualization architecture
JP2007183951A (en) * 2005-12-30 2007-07-19 Intel Corp Transmission of direct interrupt to virtual processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10162657B2 (en) 2013-04-22 2018-12-25 Fujitsu Limited Device and method for address translation setting in nested virtualization environment

Also Published As

Publication number Publication date
JP5369356B2 (en) 2013-12-18

Similar Documents

Publication Publication Date Title
JP4864817B2 (en) Virtualization program and virtual computer system
JP5405799B2 (en) Virtual computer control method, virtualization program, and virtual computer system
CN101271401B (en) Server cluster unit system with single system image
US7979869B2 (en) Method and system for performing I/O operations using a hypervisor
US9009707B2 (en) Sharing reconfigurable computing devices between workloads
US20210224100A1 (en) Virtual machine migration using multiple, synchronized streams of state data
Vallee et al. System-level virtualization for high performance computing
NO340567B1 (en) Hierarchical virtualization with a multi-level virtualization mechanism
US11693722B2 (en) Fast memory mapped IO support by register switch
JP5608797B2 (en) Virtualization program, virtual computer system, and computer system control method
JP5369356B2 (en) Virtualization program
US11720388B2 (en) Management of dynamic sharing of central processing units
JP5584811B2 (en) Virtual computer control method, virtualization program, and virtual computer system
JP2006522971A (en) operating system
JP5754294B2 (en) Information processing apparatus, information processing method, and information processing program
Groesbrink Basics of virtual machine migration on heterogeneous architectures for self-optimizing mechatronic systems: Necessary conditions and implementation issues
Gordon et al. Lifting and Dropping VMs to Dynamically Transition Between Time-and Space-sharing for Large-Scale HPC Systems
US20230350710A1 (en) Fast memory mapped io support by register switch
Lin et al. Improving GPOS real-time responsiveness using vCPU migration in an embedded multicore virtualization platform
Sawada A hierarchical circuit extractor based on new cell overlap analysis
KR20080079852A (en) Cpu virtualization method
Kourai et al. Virtual AMT for Unified Management of Physical and Virtual Desktops
Mathur Reducing the Latency of Interaction with the Power Servers
Kaneda et al. Virtualizing a Multiprocessor Machine on a Network of Computers
林宗翰 Addressing Hybrid OS Environment Issues in the Embedded Virtualization Multicore Platform

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20111109

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120125

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20120322

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130523

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20130604

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20130731

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: 20130820

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130830

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

LAPS Cancellation because of no payment of annual fees