JP5085611B2 - Computer program that transitions between real and virtual environments - Google Patents
Computer program that transitions between real and virtual environments Download PDFInfo
- Publication number
- JP5085611B2 JP5085611B2 JP2009153057A JP2009153057A JP5085611B2 JP 5085611 B2 JP5085611 B2 JP 5085611B2 JP 2009153057 A JP2009153057 A JP 2009153057A JP 2009153057 A JP2009153057 A JP 2009153057A JP 5085611 B2 JP5085611 B2 JP 5085611B2
- Authority
- JP
- Japan
- Prior art keywords
- state
- guest
- power
- environment
- computer system
- 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.)
- Active
Links
- 230000007704 transition Effects 0.000 title claims description 29
- 238000004590 computer program Methods 0.000 title claims description 20
- 238000000034 method Methods 0.000 claims description 32
- 230000006266 hibernation Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 8
- 241000700605 Viruses Species 0.000 claims description 6
- 230000004044 response Effects 0.000 claims description 3
- 238000012545 processing Methods 0.000 claims description 2
- 230000000977 initiatory effect Effects 0.000 claims 1
- 230000007246 mechanism Effects 0.000 description 8
- 238000005516 engineering process Methods 0.000 description 6
- 238000012423 maintenance Methods 0.000 description 6
- 238000010586 diagram Methods 0.000 description 5
- 230000005012 migration Effects 0.000 description 5
- 238000013508 migration Methods 0.000 description 5
- 238000007689 inspection Methods 0.000 description 4
- 230000008439 repair process Effects 0.000 description 4
- 230000006870 function Effects 0.000 description 3
- 230000008901 benefit Effects 0.000 description 2
- 230000002155 anti-virotic effect Effects 0.000 description 1
- 230000002457 bidirectional effect Effects 0.000 description 1
- 230000015556 catabolic process Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 238000006731 degradation reaction Methods 0.000 description 1
- 230000000694 effects Effects 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
- 230000009467 reduction Effects 0.000 description 1
- 230000002618 waking effect Effects 0.000 description 1
Images
Landscapes
- Power Sources (AREA)
Description
本発明は、コンピュータ・システムを実環境と仮想環境の間で双方向に遷移させる技術に関する。 The present invention relates to a technology for causing a computer system to transition bi-directionally between a real environment and a virtual environment.
パーソナル・コンピュータやサーバでは、ハイパーバイザまたは仮想計算機モニタ(VMM:Virtual Machine Monitor)といわれる仮想化プログラムを導入することで仮想環境を形成し、複数のオペレーティング・システム(OS)を動作させたり、ハードウエアのクラスタリングなどをしたりすることが可能である。これにより、サーバにおいては例えば既存のサーバを統合したり、特定のハードウエアで動作することを前提にしているOSやアプリケーション・プログラムを最新のハードウエアで動作させたり、状況に応じてOSを切り換えたりすることができるという利点がある。しかし、仮想環境で動作するOSは、仮想化プログラムがロードされていない通常のOS環境である実環境で動作するOSに比べて、仮想化プログラムによるオーバーヘッドが増加してパフォーマンスが低下したり、メモリやCPUなどのリソースを余分に消費したりするといった欠点もある。 In a personal computer or server, a virtual environment called a hypervisor or a virtual machine monitor (VMM) is introduced to form a virtual environment and a plurality of operating systems (OS) can be operated. It is possible to perform clustering of wear. As a result, for example, existing servers can be integrated in the server, OSs and application programs that are supposed to run on specific hardware can be run on the latest hardware, and the OS can be switched according to the situation. There is an advantage that can be. However, an OS that operates in a virtual environment has an increased overhead due to the virtualization program and has a lower performance or memory than an OS that operates in a real environment that is a normal OS environment in which the virtualization program is not loaded. There is also a drawback that extra resources such as CPU and CPU are consumed.
特許文献1は、ホストOS上でゲストOSが動作する仮想計算機システムにおいて、ホストOSに障害が発生したときに、ゲストOSを再起動することなくハードウエアアクセスについてゲストOSとホストOSの依存関係を切り換える技術を開示する。同文献には、ゲストOSをホストに、ホストOSをゲストに切替えるとき、ゲストOSが、ゲストOSのゲストメモリ管理情報とホストOSのホストメモリ管理情報とに基づいて、切り替え後のホストOSのメモリ管理情報となる新規ゲストメモリ管理情報と、切り替え後のゲストOS300のメモリ管理情報となる新規ホストメモリ管理情報とを生成することが記載されている。 Japanese Patent Laid-Open No. 2004-151867 describes a dependency relationship between a guest OS and a host OS for hardware access without restarting the guest OS when a failure occurs in the host OS in a virtual machine system in which the guest OS runs on the host OS. A technique for switching is disclosed. In this document, when the guest OS is switched to the host and the host OS is switched to the guest, the guest OS changes the memory of the host OS after switching based on the guest memory management information of the guest OS and the host memory management information of the host OS. It describes that new guest memory management information as management information and new host memory management information as memory management information of the guest OS 300 after switching are generated.
特許文献2は、物理マシン上に仮想マシン環境と複数の仮想マシンが構築されている仮想マシンシステムにおいて、OSの再起動をすることなく、仮想マシンで使用できるメモリの拡大および縮小を可能にする技術を開示する。同文献には、仮想マシン環境上で動作する複数の仮想マシンのそれぞれが使用可能なメモリ領域を、物理マシンが有する物理メモリに対応付け、各仮想マシンの使用メモリの量に応じて、メモリ領域の所定の領域を、各仮想マシンに対して割り当てと解放が可能な予約領域として配置することが記載されている。 Patent Document 2 enables expansion and reduction of memory usable in a virtual machine without restarting the OS in a virtual machine system in which a virtual machine environment and a plurality of virtual machines are constructed on a physical machine. Disclose technology. In this document, a memory area that can be used by each of a plurality of virtual machines operating in a virtual machine environment is associated with a physical memory that the physical machine has, and the memory area is determined according to the amount of used memory of each virtual machine. This predetermined area is described as a reserved area that can be allocated and released to each virtual machine.
特許文献3には、マルチOSを切り換える従来技術として、OSの実行環境をハードディスクにサスペンドする技術が記載されている。同文献には、BIOSがハードウエアを初期化して、ハードディスクからOSの実行環境を取得することが記載されている。特許文献4は、コンピュータをサスペンド状態に移行させた直後にレジュームしてシステムBIOSに制御を移す技術を開示する。 Patent Document 3 describes a technique for suspending an OS execution environment to a hard disk as a conventional technique for switching between multiple OSs. This document describes that the BIOS initializes the hardware and acquires the execution environment of the OS from the hard disk. Patent Document 4 discloses a technique for resuming immediately after shifting a computer to a suspended state and transferring control to the system BIOS.
仮想環境の使用例は、前述のような利点の他にも考えられる。近年、コンピュータ・ウィルス、ワーム、スパイウエアといった悪意のあるソフトウエア(マルウエア)が頻繁にネットワーク経由でユーザのコンピュータ・システムに送られてくる。そのようなソフトウエアの多くは、ファイアウォールやウィルス対策のソフトエアなどにより発見され駆除される。しかし、ルートキットと呼ばれる最近開発されたソフトウエア・ツール技術は、そのようなマルウエアの存在を隠蔽して検出を困難にする。たとえばルートキットは、アプリケーション・プログラムが情報入手に利用するAPIの処理を横取りし、プログラムのリストからマルウエアのプログラムを削除して隠蔽してしまうことがある。そうすると、ウィルス駆除プログラムはもはやマルウエアを発見することができなくなってしまう。 The usage example of the virtual environment can be considered in addition to the above-described advantages. In recent years, malicious software (malware) such as computer viruses, worms, and spyware is frequently sent to a user's computer system via a network. Most of such software is discovered and removed by firewalls and anti-virus software. However, a recently developed software tool technology called a rootkit hides the presence of such malware and makes it difficult to detect. For example, a rootkit may intercept an API process used by an application program to obtain information and delete a malware program from the program list to hide it. Then, the virus removal program can no longer find the malware.
しかも、OS自身がルートキットの存在を認識しようとしても、すでにOSにルートキットが潜んでいるような場合はそれも困難になる。そのようなときに、検査対象となるOSとは別の検査用のOSを同じ仮想環境で動作させて、検査用のOSが検査対象となるOSのメイン・メモリに展開されたコードを調べたり、OSが格納されていたハードディスクや不揮発性メモリなどのストレージにあるファイルを調べたりすることで、ルートキットやマルウエアの存在を検出することができる。また、OSを部分的に修復するような場合も、実理環境で行うよりも仮想環境で別のOSによって行うほうが安全である。しかし、このようなOSの検査や修復のようなメインテナンス作業は定期的にまたは必要に応じて行えばよいので、OSを常時パフォーマンスが低下したりリソースを余分に消費したりする仮想環境で動作させる必要はない。したがって、通常はOSを実環境で動作させ、必要に応じて仮想環境に移行して作業を行いまた実環境に戻ることを移行前のシステム状態を維持しながら行うことができれば、OSのメインテナンスには都合がよい。 Moreover, even if the OS itself tries to recognize the existence of the rootkit, it becomes difficult if the rootkit already lurks in the OS. In such a case, an inspection OS different from the OS to be inspected is operated in the same virtual environment, and the inspection OS examines the code expanded in the main memory of the OS to be inspected. The existence of a rootkit or malware can be detected by examining a file in a storage such as a hard disk or a nonvolatile memory in which the OS is stored. Also, even when the OS is partially repaired, it is safer to use another OS in the virtual environment than to use the physical environment. However, since maintenance work such as inspection and repair of the OS may be performed periodically or as necessary, the OS is operated in a virtual environment in which performance is constantly reduced or resources are excessively consumed. There is no need. Therefore, if the OS can be operated in the real environment, and if necessary, the operation can be performed after moving to the virtual environment and returning to the real environment while maintaining the system state before the migration, the OS can be maintained. Is convenient.
そこで本発明の目的は、実環境から仮想環境に実環境でのシステム状態を維持しながら移行することができるコンピュータ・プログラムを提供することにある。さらに本発明の目的は、仮想環境から実環境に仮想環境でのシステム状態を維持しながら移行することができるコンピュータ・プログラムを提供することにある。さらに本発明の目的は、実環境でのシステム状態を維持しながら一時的に仮想環境に移行してメインテナンス作業を行い、再び実環境に移行することができるコンピュータ・プログラムを提供することにある。さらに、本発明の目的は、実環境から仮想環境への移行、および仮想環境から実環境への移行を短時間で自動的に行うことができるコンピュータ・プログラムを提供することにある。 Therefore, an object of the present invention is to provide a computer program that can be migrated from a real environment to a virtual environment while maintaining the system state in the real environment. A further object of the present invention is to provide a computer program that can be migrated from a virtual environment to a real environment while maintaining the system state in the virtual environment. Furthermore, an object of the present invention is to provide a computer program that can temporarily move to a virtual environment while maintaining the system state in the real environment, perform maintenance work, and move to the real environment again. Another object of the present invention is to provide a computer program capable of automatically performing a migration from a real environment to a virtual environment and a migration from a virtual environment to a real environment in a short time.
本発明は、サーバやクライアントなどのような実環境と仮想環境のいずれでも動作することが可能なコンピュータ・システムに適用することができる。最初にコンピュータ・システムは実環境でOSを実行する。そして、コンピュータ・システムはパワー・オン状態からシステム状態の保持が可能な節電状態へ移行した後に節電状態からパワー・オン状態への復帰を開始する。節電状態への移行のきっかけは、内部で生成した信号や外部から受け取った信号を利用することができる。システム状態の保持が可能な節電状態は、パワー・オン状態よりも消費電力が少なく、かつ、パワー・オン状態に復帰したときには節電状態へ移行する前のシステム状態に復帰できる動作状態をいい、サスペンド状態やハイバネーション状態が含まれる。 The present invention can be applied to a computer system that can operate in either a real environment or a virtual environment such as a server or a client. First, the computer system executes the OS in a real environment. Then, after the computer system shifts from the power-on state to the power-saving state in which the system state can be maintained, the computer system starts to return from the power-saving state to the power-on state. As a trigger for the transition to the power saving state, an internally generated signal or a signal received from the outside can be used. The power saving state in which the system state can be maintained is an operating state that consumes less power than the power on state and can return to the system state prior to entering the power saving state when the power on state is restored. State and hibernation state are included.
つづいて、コンピュータ・システムが節電状態からパワー・オン状態に復帰するまでの間に仮想化プログラムをメイン・メモリに確保された所定の領域にロードし実行する。その後OSをレジュームして仮想環境に移行する。このような手順を実行すると、実環境で動作していたコンピュータ・システムを、実環境の動作状態を保持しながら仮想環境に自動的に移行することができる。節電状態をサスペンド状態としたときには、サスペンド状態に移行したことに応答してパワー・オン状態に移行するようにすれば、きわめて短時間でコンピュータ・システムの実行環境を移行することができる。サスペンド状態に移行したことに応答してとは、システム状態を維持する処理が完了して電源の状態が当該コンピュータ・システムで定義された節電状態に移行したことに続いて行うということを意味しており、節電状態に移行してから他の条件に基づくイベントが生成されることを待っていたり、タイマで所定の時間が経過することを待っていたりした後に続いて行うようなことは含まない。 Subsequently, the virtualization program is loaded into a predetermined area secured in the main memory and executed until the computer system returns from the power saving state to the power on state. Then, resume the OS and move to the virtual environment. When such a procedure is executed, the computer system operating in the real environment can be automatically transferred to the virtual environment while maintaining the operating state of the real environment. When the power saving state is changed to the suspended state, the execution environment of the computer system can be shifted in a very short time if the power saving state is shifted in response to the transition to the suspended state. Responding to the transition to the suspend state means that the process for maintaining the system state is completed and the power state is changed to the power saving state defined by the computer system. It does not include waiting for an event based on other conditions to be generated after entering the power saving state, or waiting for a predetermined time to elapse with a timer. .
仮想環境から実環境へ移行するときは、実環境から仮想環境への移行のときと同様にコンピュータ・システムはパワー・オン状態からシステム状態の保持が可能な節電状態へ移行した後に節電状態からパワー・オン状態への復帰を開始する。コンピュータ・システムが節電状態からパワー・オン状態に復帰するまでの間に仮想化プログラムをメイン・メモリの所定の領域からアンロードし、さらにOSをレジュームすることで実環境に移行する。このような手順を実行すると、仮想環境で動作していたコンピュータ・システムを、仮想環境でのシステム状態を保持しながら実環境に移行することができる。仮想化プログラムをアンロードするということは、仮想化プログラムをメイン・メモリ上で実行不能にすることを意味しており、同時に仮想化プログラムの実行環境を不揮発性のメモリに格納してもよく、また、単に仮想化プログラムのコードを読み取ることができないように上書きしてクリアすることでもよい。 When migrating from the virtual environment to the real environment, the computer system transitions from the power-on state to the power-saving state where the system state can be maintained, as in the case of the transition from the real environment to the virtual environment.・ Start returning to the ON state. Before the computer system returns from the power saving state to the power on state, the virtualization program is unloaded from a predetermined area of the main memory, and the OS is resumed to shift to the real environment. When such a procedure is executed, the computer system operating in the virtual environment can be transferred to the real environment while maintaining the system state in the virtual environment. Unloading the virtualization program means that the virtualization program cannot be executed on the main memory, and at the same time the execution environment of the virtualization program may be stored in a non-volatile memory. Alternatively, the code of the virtualization program may be overwritten and cleared so that it cannot be read.
OSが実環境で動作した後に、OSは、仮想化プログラムがアンロードされたメイン・メモリの所定の領域を自らの使用のために解放することができる。こうすることで、実環境では必要のない仮想化プログラムに対してメイン・メモリを割り当てておく必要をなくして、メモリ資源を有効に活用することができる。仮想化プログラムをロードするためのメイン・メモリの領域は、OSが実環境で動作している間は常時確保するようにしておいてもよいし、あるいは、SMRAM領域の一部を利用して確保してもよい。 After the OS operates in the real environment, the OS can release a predetermined area of the main memory where the virtualization program is unloaded for its own use. By doing this, it is not necessary to allocate main memory to virtualized programs that are not necessary in the real environment, and memory resources can be used effectively. The main memory area for loading the virtualization program may be secured at all times while the OS is operating in the real environment, or may be secured using a part of the SMRAM area. May be.
上記の手順によれば、通常はパフォーマンスが良好でメイン・メモリを必要以上に消費しない実環境で動作させ、必要なときだけ仮想環境で動作させることができるので都合がよい。特に、実環境では十分に行うことができず、しかも、常に実環境で行う必要がないような、OSのウィルス検査や修復を仮想環境で行うような場合には都合がよい。仮想化プログラムをロードしたり、アンロードしたりするのは、節電状態からパワー・オン状態に移行する間にコンピュータ・システムの制御を取得するBIOSが行うことができる。本発明にかかるコンピュータ・プログラムは、BIOS、ハイパーバイザ、およびDomain0のゲストOSなどで構成することができる。また、このコンピュータ・プログラムをサーバやクライアントなどのコンピュータ・システムに実装して動作環境の移行を行うことができる。 According to the above procedure, it is convenient to operate in a real environment that usually has good performance and does not consume more main memory than necessary, and can operate in a virtual environment only when necessary. In particular, it is convenient when performing virus inspection and repair of the OS in a virtual environment that cannot be performed sufficiently in the real environment and that is not always necessary in the real environment. The virtualization program can be loaded and unloaded by the BIOS that obtains control of the computer system during the transition from the power saving state to the power on state. The computer program according to the present invention can be composed of a BIOS, a hypervisor, a Domain0 guest OS, and the like. The computer program can be mounted on a computer system such as a server or a client to move the operating environment.
本発明により、実環境から仮想環境に実環境でのシステム状態を維持しながら移行することができるコンピュータ・プログラムを提供することができた。さらに本発明により、仮想環境から実環境に仮想環境でのシステム状態を維持しながら移行することができるコンピュータ・プログラムを提供することができた。さらに本発明により、実環境でのシステム状態を維持しながら一時的に仮想環境に移行してメインテナンス作業を行い、再び実環境に移行することができるコンピュータ・プログラムを提供することができた。さらに、本発明により、実環境から仮想環境への移行、および仮想環境から実環境への移行を短時間で自動的に行うことができるコンピュータ・プログラムを提供することができた。 According to the present invention, it is possible to provide a computer program that can be migrated from a real environment to a virtual environment while maintaining the system state in the real environment. Furthermore, according to the present invention, it is possible to provide a computer program that can be migrated from a virtual environment to a real environment while maintaining the system state in the virtual environment. Furthermore, according to the present invention, it is possible to provide a computer program capable of temporarily moving to a virtual environment while maintaining the system state in the real environment, performing maintenance work, and moving to the real environment again. Furthermore, according to the present invention, it is possible to provide a computer program capable of automatically performing a transition from a real environment to a virtual environment and a transition from a virtual environment to a real environment in a short time.
図1は、コンピュータ・システム10の本発明の説明に必要な構成を示す機能ブロック図である。ノース・ブリッジ13には、CPU11、メイン・メモリ15、ビデオ・コントローラ17、およびサウス・ブリッジ19が接続されている。コンピュータ・システム10は、ハイパーバイザ型の仮想化ソフトウエアに対してHVM(Hardware Virtual Machine)というCPUの支援による仮想化を行うことにより、OSに修正を加える必要のない完全仮想化を実現する。HVMを利用することで、Windows(登録商標)のようなソースコードが公開されていないOSも仮想環境で実行することができるようになる。
FIG. 1 is a functional block diagram showing a configuration necessary for explaining the present invention of the computer system 10. Connected to the
CPU11は、HVMを実現するための仮想化支援機構を実装している。仮想化支援機構は、たとえばインテル社のCPUに搭載されるVT(Virtualization Technology)またはAMD社のCPUに搭載されるAMD−Vという技術で提供されている。仮想化支援機構を搭載したCPU11では、OSのカーネルは通常どおりリング0の特権レベルで動作し、ハイパーバイザはリング0の上に追加された仮想的なリング−1に相当する特権レベルで動作する。ただし、本発明は、ハイパーバイザがリング0で動作し、OSのカーネルがリング1で動作するような準仮想化に適用することもできる。準仮想化は、OSが実環境で動作する場合に比べてパフォーマンスの低下が少ないが、カーネルの動作環境を変更するためにコードに修正を加える必要がある。
The
ビデオ・コントローラ17にはLCD19が接続されている。サウス・ブリッジ19にはSATA(Serial Advanced Technology Attachment)、HDA(High Definition Audio)バス、USB(Universal Serial Bus)、PCI(Peripheral Component Interconnect)バス、LPC(Low Pin Count)バスなどに対するインターフェース回路が組み込まれている。SATAインターフェースにはHDD21が接続されている。HDD21には、ハイパーバイザとしてのXen(商標)、ゲストOSとしてのWindows(登録商用)およびLinux(登録商標)が格納されている。LPCバス23には、エンベデッド・コントローラ(EC)25およびフラッシュROM27などが接続されている。
An
EC25は、8〜16ビットのCPU、ROM、RAMなどで構成されたマイクロ・コンピュータであり、さらに複数チャネルのA/D入力端子、D/A出力端子、タイマ、およびディジタル入出力端子を備えている。EC25は、コンピュータ・システム10の内部の温度や電源などの動作環境の管理にかかるプログラムをCPU11とは独立して実行することができる。EC25は、キーボード・コントローラを含んでおり、キーボード29が接続されている。コンピュータ・システム10はACPI(Advanced Configuration and Power Interface)の規格に適合しており、フラッシュROM27には、ACPIに対応するBIOSが格納されている。
The EC25 is a microcomputer composed of an 8- to 16-bit CPU, ROM, RAM, and the like, and further includes a multi-channel A / D input terminal, a D / A output terminal, a timer, and a digital input / output terminal. Yes. The
ACPIの規格では、複数のパワーステートが定義されており、コンピュータ・システム10は、パワー・オン状態であるS0ステート、作業内容をメイン・メモリ15に書き込んでメイン・メモリ15の記憶を保持するために必要なデバイスと再起動に必要なデバイスにだけ電力を供給するサスペンド状態というS3ステート、作業内容をHDD21やその他の不揮発性メモリなどに書き込んで再起動に必要なデバイスにだけ電力を供給するハイバネーション状態というS4ステート、および再起動に必要なデバイスにだけ電力を供給するソフトオフまたはパワー・オフ状態というS5ステートのいずれかの状態に移行することができる。サスペンド状態では、サウス・ブリッジ19、EC25およびフラッシュROM27への電力は維持されている。
In the ACPI standard, a plurality of power states are defined, and the computer system 10 writes the S0 state, which is in the power-on state, and the work contents to the
図2は、コンピュータ・システム10が実環境で動作するときと仮想環境で動作するときのソフトウエアの構成を説明する図である。図2(A)はコンピュータ・システム10が実環境で動作するときの状態を示しており、ハードウエア105上でゲストOS101が動作し、ゲストOS上ではアプリケーション102が動作する。ゲストOS101はアプリケーションに対してCPU11、HDD25、メイン・メモリ13、およびフラッシュROM27などのコンピュータ・システム10に搭載されているハードウエア105を抽象化する。BIOS103は、ゲストOS101またはアプリケーション102からの指示でハードウエア105に直接アクセスすることができる。
FIG. 2 is a diagram illustrating a software configuration when the computer system 10 operates in a real environment and when it operates in a virtual environment. FIG. 2A shows a state when the computer system 10 operates in a real environment. The
なお、ゲストOSには、実環境で動作するときは「ゲスト」という概念は存在しないが、実環境で動作するときは、仮想環境で動作するときとモジュールの構成には変わりがないので、説明の都合上実環境で動作するときもゲストOS101として表現する。ゲストOS101は、本実施の形態ではWindows(登録商標)とする。図2(B)はコンピュータ・システム10が仮想環境で動作するときの状態を示しており、ハイパーバイザ109がハードウエア105の上に仮想化層として存在し、ゲストOS101、107に対する仮想マシンを提供する。ゲストOS101、107は、ハイパーバイザ109の上でアプリケーションと同じようにそのサービスを受けながら動作する。本実施の形態では、ハイパーバイザ109はオープンソース・ソフトウエアとして提供されているXenを採用し、ゲストOS107としてはLinux(登録商標)を採用しているがこの選定は一例である。ゲストOS107はハイパーバイザ107のDomain0として実行されて、特別な権限が与えられてハードウエア105へのアクセスが許可される。ゲストOS101はハイパーバイザのDomainUとして実行される。
The guest OS does not have the concept of “guest” when operating in a real environment, but when operating in a real environment, the module configuration is the same as when operating in a virtual environment. For convenience, it is expressed as a
ゲストOS107には、ゲストOS101のウィルスを検査したり、ゲストOS101を修復したりするメインテナンス・システムが組み込まれている。メインテナンス・システムは、ハイパーバイザ109のモジュールの一部として構成することでもよい。本実施の形態では、CPU11の仮想化支援機構を利用して仮想環境を実現しているため、ゲストOS101には修正を加える必要がない。また、ハードウエア105も必要に応じて行う仮想化支援機構の設定変更以外は修正する必要がない。ただし、ハイパーバイザ109およびBIOS103には、図3、図5の手順を実行するための機能を組み込む必要がある。
The
図3は、コンピュータ・システム10が実環境から仮想環境に移行するときの手順を示すフローチャートである。ブロック301では、コンピュータ・システム10が実環境においてパワー・オン状態で動作し、図2(A)に示す状態でプログラムが実行されている。ブロック303では、コンピュータ・システム10に仮想環境に移行するためのイベントが生成されゲストOS101が受け取る。本実施の形態における仮想環境への移行は、ゲストOS101を検査したりメインテナンスしたりするために一時的に行われる。イベントは、ユーザがキーボード29のキーに割り当てられた特別なキーを操作したことをBIOS103が検知して生成したり、ゲストOS101上で実行されているスケジュール管理用のアプリケーションが定期的に生成したりすることができる。
FIG. 3 is a flowchart showing a procedure when the computer system 10 shifts from the real environment to the virtual environment. In
イベントは、コンピュータ・システム10をサスペンドに移行させることを含む。コンピュータ・システム10では、サスペンドへの移行が通常のサスペンドと、実環境と仮想環境との間の動作モードの遷移を目的とするサスペンドとの2とおりが実行される。ゲストOS101およびBIOS103は、イベントが通常サスペンドを目的とするものか動作環境の遷移を目的とするものかを認識することができるようになっている。ただし、コンピュータ・システム10に通常のサスペンド状態に移行するイベントが発生したときは、常に図3または図5の手順を実行するようにあらかじめBIOS103に設定しておいてもよい。
The event includes transitioning the computer system 10 to suspend. In the computer system 10, transition to suspend is performed in two ways: normal suspend and suspend for the purpose of transition of the operation mode between the real environment and the virtual environment. The
ブロック305では、ゲストOS101が、ACPIのプラグアンド・プレイの機能を利用して、ゲストOS101に対してメイン・メモリ15に割り当てられていた記憶領域をダイナミックに低減して、その分をハイパーバイザ109とゲストOS107をロードするために割り当てる。図4は、ハイパーバイザ109とDomain0のゲストOS107のモジュールをロードするために、メイン・メモリ15の記録領域を確保する様子を示す図である。この例では、メイン・メモリ15の容量は2GBであり、それに対してCPU11は32ビットでデータ処理をすることができるためプログラムは4GBの論理アドレス空間を利用することができる。図4には、メイン・メモリ15に対応する2GBの物理アドレス空間201と、ハイパーバイザ109とゲストOS107に対応するリニア・アドレス空間203と、ゲストOS101に対応するリニアドレス空間205が示されている。
In
リニア・アドレス空間205には、ブロック301でゲストOS101が動作している間は、仮想アドレス領域213、215が割り当てられ、物理アドレス空間201の物理アドレス領域209、211がそれらにマッピングされて、ページング機能を利用してゲストOS109が実行されている。ここでゲストOS101は、ハイパーバイザ109とゲストOS107に割り当てるための物理アドレス領域211を低減して、ハイパーバイザ109とゲストOS107に仮想アドレス領域207を割り当て、自らの仮想アドレス領域を213に低減する。そして、ハイパーバイザ109とゲストOS107には、物理アドレス領域211にマッピングされた仮想アドレス領域207を割り当て、ゲストOS213には物理アドレス領域209にマッピングされた仮想アドレス領域213を割り当てることで、ハイパーバイザ109をロードできるようにする。
While the
ブロック307では、BIOS103がEC25のレジスタに、EC25に対してコンピュータ・システム10がサスペンド状態に移行した状態を示す情報が入力されたときに、コンピュータ・システム10をパワー・オン状態に移行させるための瞬時ウェイクアップの設定をする。この設定はRTC(Real Time Clock)を利用して行うようにしてもよい。そして、BIOS103は、EC25への瞬時ウェイクアップの設定が終了するとゲストOS101にその旨を通知する。ただし、本発明における動作環境の移行は、ウェイクアップが瞬時に行われない場合でも行うことができる。
In
ブロック309では、ゲストOS101は、CPU11や他のデバイスのレジスタに記憶された情報などのブロック301で動作する状態を維持するために必要な情報をすべてメイン・メモリ15に記憶したのちに、サウス・ブリッジ19にコンピュータ・システム10をサスペンド状態に移行させるための電源の処理をさせる。つづいて、コンピュータ・システム10のステート・マシーンは、コンピュータ・システム10の電源状態がサスペンド状態に移行したことをEC25に通知する。コンピュータ・システム10がサスペンド状態に移行すると、CPU11に供給されていた電力が停止してリセットされる。通知を受け取ったEC25は、コンピュータ・システム10をウェイクアップさせてパワー・オン状態への移行を開始させる。なお、この時点でゲストOS101のモジュールは、仮想アドレス領域213にマッピングされた物理アドレス領域209にロードされている。
In
CPU11は、リセットされてから動作を開始するときには、最初にBIOS103を実行するようにアドレスが指定される。ブロック311では、BIOS103が仮想アドレス領域207にマッピングされたメイン・メモリ15の物理アドレス領域211にHDD25からハイパーバイザ109とゲストOS107のモジュールをロードする。そして、必要に応じてCPU11の仮想化支援機構をイネーブルにしたり、ノース・ブリッジ13に含まれるメモリ・コントローラの設定を変更したりする。ブロック313では、BIOS103のなかのレジュームを行うためのコードが実行されて、SMIの設定および必要なハードウエアの設定が行われる。つづいて、ハイパーバイザ109に制御が移りハイパーバイザ109はレジュームして必要な処理を行う。つづいて、ハイパーバイザ109がゲストOS107の所定のアドレスに制御を移すとゲストOS107がレジュームする。
When the
ブロック315では、ゲストOS107がハイパーバイザ109に制御を移し、ハイパーバイザ109がゲストOS101の復帰アドレスに制御を移すと、ゲストOS101がレジュームしてメイン・メモリ15に記憶されていたレジスタの情報を各レジスタに戻す。その結果、コンピュータ・システム10は、仮想環境が実現された状態でブロック301のシステム状態に復帰する。ブロック315では、コンピュータ・システム10が図2(B)に示した仮想環境で動作し、ゲストOS107に組み込まれたメインテナンス・システムがゲストOS101のウィルスを検査したり、ゲストOS101を修復したりする。
In
上記の手順では、ブロック305の手順でハイパーバイザ109とゲストOS107をロードするためのメイン・メモリ15の物理アドレス領域211を確保したが、メイン・メモリの物理アドレス領域を確保するには他の方法もある。CPU11は、SMI(System Management Interrupt)入力ピン(SMI#)がアサートされることによって、システム管理用の動作モードであるSMM(System Management Mode)で動作することが可能である。SMMを実現するために、メイン・メモリ15には、コンピュータ・システム10がSMMで動作するときにCPU11が独占的に使用できるSMRAM領域が確保されている。メイン・メモリ15には、本来のSMMの実行に必要なSMRAMの容量に加えて、ハイパーバイザ109とゲストOS107をロードするのに必要な容量がSMRAMとしてあらかじめ確保されている。
In the above procedure, the
そして、コンピュータ・システム10が実環境で動作するときは、SMRAM領域全体がゲストOS101からアクセスできないように、ノース・ブリッジ13に組み込まれたメモリ・コントローラが設定されている。BIOS103は、メモリ・コントローラに対して、SMRAM領域の一部が物理アドレス領域211の分だけゲストOS107がアクセスできるように解放する。この方法は、サスペンド状態からウェイクアップしてBIOS103に制御が移行したときにBIOS103により実行されるようにする。メイン・メモリ15に確保する物理アドレス領域はSMRAM領域ではなく、OS107からのアクセスが可能なメイン・メモリ15の通常の記憶領域の一部に確保しておいてもよい。
When the computer system 10 operates in a real environment, a memory controller incorporated in the
図5は、コンピュータ・システム10が仮想環境から実環境に移行するときの手順を示すフローチャートである。ブロック401では、図3に示した手順を経てコンピュータ・システム10が図2(B)に示す仮想環境においてパワー・オン状態で動作している。ブロック303では、コンピュータ・システム10に実環境に移行するためのイベントが生成されゲストOS101がそれを受け取る。ブロック403、405、407は、図3のブロック303、307、309で説明したのと同じ手順で実行される。ただし、サスペンド状態への移行作業は、ゲストOS101だけでなくハイパーバイザ109およびゲストOS107も行う。
FIG. 5 is a flowchart showing a procedure when the computer system 10 shifts from the virtual environment to the real environment. In
ブロック407では、サスペンド状態に移行するために、ゲストOS101がBIOS103に含まれるACPIテーブルを参照して必要な情報を収集する。OS環境での状態遷移が終了したあとに、ゲストOS101はACPIテーブルから得た仮想ハードウエアのI/OアドレスにI/O命令を出して、サスペンド状態への移行作業を行う。同様にゲストOS107も仮想ハードウエアにI/O命令を出してサスペンド状態への移行作業を行う。ハイパーバイザ109は、ゲストOS101とゲストOS107によるサスペンド状態への移行作業が終了したことを確認すると、実際のハードウエア105にI/O命令を出してサスペンド状態に移行する。必要に応じて、サスペンド状態に移行するためにBIOS103がI/O命令をトラップしてサウス・ブリッジ19を設定する。
In
サスペンド状態に移行したコンピュータ・システム10では、メイン・メモリ15の物理アドレス領域211にハイパーバイザ109およびゲストOS107のモジュールが記憶され、物理アドレス領域209にはゲストOS101のモジュールが記憶されている。ブロック409では、BIOS103がハイパーバイザ109とゲストOS107のモジュールをメイン・メモリ15からアンロードし、さらに、記憶内容をゼロ・クリアして他のプログラムから記憶されていた情報が読み取られないようにする。ブロック411では、ゲストOS101のモジュールがレジュームする。この時点で、ゲストOS101にはまだ、物理アドレス領域209が割り当てられている。
In the computer system 10 that has transitioned to the suspended state, the
ブロック413では、ゲストOS101が、ハイパーバイザ109とゲストOS107に割り当てられていた物理アドレス領域211を解放して自らの物理アドレス領域として使用するために、リニア・アドレス空間205に仮想アドレス領域215を追加する。したがって、仮想環境から実環境に移行したときに、ゲストOS101は、メイン・メモリ15で使用できるアドレス領域を拡大することができるので、仮想環境の一時的な利用のためにメモリ・リソースが低下することを防ぐことができる。図3の手順でSMRAM領域の一部を物理アドレス領域として使用していた場合は、BIOS103は、そのアドレス領域にOS101やアプリケーションがアクセスできないように、メモリ・コントローラに設定する。
In
図3、図5の手順では、サスペンド状態への遷移を介在させて実環境と仮想環境の双方向の移行を実現する方法を説明したが、本発明は、ハイバネーション状態を介在させて実現することもできる。通常ハイバネーションからウェイクアップするときは、コンピュータ・システム10に、キーボード29、筐体のスイッチ、またはネットワークからのウェイク・オン・ラン(Wake On LAN)機能などを通じてウェイクアップの信号が供給される。本発明を、ハイバネーションを経由して実現する上では、そのような方法でウェイクアップさせてもよいが、コンピュータ・システム10の中で管理するスケジュール管理機構がイベントを生成して動作環境の移行を強制的に行わせるようにしてもよい。
In the procedure of FIGS. 3 and 5, the method of realizing the bidirectional transition between the real environment and the virtual environment through the transition to the suspend state has been described. However, the present invention can be implemented through the hibernation state. You can also. When waking up from normal hibernation, a wake-up signal is supplied to the computer system 10 through a
また、図3、図5の手順では、ブロック309、407で、サスペンド状態に移行したことに応答してウェイクアップが開始するようになっているが、本発明は、サスペンド状態に移行してからキーボードからの信号入力、ウェイク・オン・ランまたはスケジュール管理機構のイベントに基づいてウェイクアップさせるようにしてもよい。さらに双方向への動作環境の移行を、サスペンド状態の介在とハイバネーション状態の介在のいずれも採用して行うようにしてもよい。サスペンド状態を経由する場合でもハイバネーション状態を経由する場合でも、本発明では、実環境と仮想環境の間での移行を移行前のシステムの状態を保持しながら行うことにより移行先では移行前のシステム状態に復帰することができる。
3 and 5, the
これまで本発明について図面に示した特定の実施の形態をもって説明してきたが、本発明は図面に示した実施の形態に限定されるものではなく、本発明の効果を奏する限り、これまで知られたいかなる構成であっても採用することができることはいうまでもないことである。 Although the present invention has been described with the specific embodiments shown in the drawings, the present invention is not limited to the embodiments shown in the drawings, and is known so far as long as the effects of the present invention are achieved. It goes without saying that any configuration can be adopted.
201…物理アドレス空間
203、205…リニア・アドレス空間
207、213、215…仮想アドレス領域
209、211…物理アドレス領域
201 ...
Claims (10)
前記実環境でオペレーティング・システムを実行するステップと、
前記コンピュータ・システムをパワー・オン状態からシステム状態の保持が可能な節電状態へ移行した後に該節電状態から該パワー・オン状態への復帰を開始するステップと、
前記コンピュータ・システムが前記節電状態から前記パワー・オン状態に復帰するまでの間に前記仮想化プログラムをメイン・メモリに確保された所定の領域にロードするステップと、
前記仮想化プログラムを実行するステップと、
前記オペレーティング・システムをレジュームして前記仮想環境に移行するステップと
を有する処理を実行させるコンピュータ・プログラム。 To computer systems that can operate in real and virtual environments,
Running an operating system in the real environment;
Initiating a return from the power saving state to the power on state after the computer system transitions from a power on state to a power saving state capable of maintaining the system state;
Loading the virtualization program into a predetermined area secured in main memory until the computer system returns from the power saving state to the power on state;
Executing the virtualization program;
Resuming the operating system and migrating to the virtual environment.
前記仮想環境で動作する前記コンピュータ・システムを前記パワー・オン状態からシステム状態の保持が可能な節電状態へ移行した後に該節電状態から前記パワー・オン状態への復帰を開始するステップと、
前記コンピュータ・システムが前記節電状態から前記パワー・オン状態に復帰するまでの間に前記仮想化プログラムを前記所定の領域からアンロードするステップと、
前記オペレーティング・システムをレジュームして前記実環境に移行するステップと
を有する請求項1に記載のコンピュータ・プログラム。 The process is
Starting the return from the power saving state to the power on state after the computer system operating in the virtual environment has transitioned from the power on state to a power saving state capable of maintaining the system state;
Unloading the virtualization program from the predetermined area before the computer system returns from the power saving state to the power on state;
The computer program according to claim 1, further comprising: resuming the operating system and moving to the real environment.
前記実環境で動作した後に、前記オペレーティング・システムは前記仮想化プログラムがアンロードされた前記所定の領域を前記オペレーティング・システムに解放するステップを有する請求項2に記載のコンピュータ・プログラム。 The computer program according to claim 2, wherein, after the processing is executed in the real environment, the operating system includes a step of releasing the predetermined area in which the virtualization program is unloaded to the operating system.
前記オペレーティング・システムが実環境で動作している間に、前記オペレーティング・システムが使用していた前記メイン・メモリの領域の一部を前記所定の領域として確保するステップを有する請求項1から請求項3のいずれかに記載のコンピュータ・プログラム。 The process is
2. The method according to claim 1, further comprising a step of allocating a part of the area of the main memory used by the operating system as the predetermined area while the operating system is operating in a real environment. 4. The computer program according to any one of 3.
前記オペレーティング・システムが実環境で動作している間に、SMRAM領域の一部を前記所定の領域として提供するステップを有する請求項1から請求項3のいずれかに記載のコンピュータ・プログラム。 The process is
4. The computer program according to claim 1, further comprising the step of providing a part of an SMRAM area as the predetermined area while the operating system is operating in a real environment.
前記仮想環境において、前記オペレーティング・システムのウィルスを検査するステップを有する請求項1から請求項8のいずれかに記載のコンピュータ・プログラム。 The process is
The computer program according to claim 1, further comprising a step of checking for a virus in the operating system in the virtual environment.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009153057A JP5085611B2 (en) | 2009-06-27 | 2009-06-27 | Computer program that transitions between real and virtual environments |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2009153057A JP5085611B2 (en) | 2009-06-27 | 2009-06-27 | Computer program that transitions between real and virtual environments |
Publications (2)
Publication Number | Publication Date |
---|---|
JP2011008646A JP2011008646A (en) | 2011-01-13 |
JP5085611B2 true JP5085611B2 (en) | 2012-11-28 |
Family
ID=43565195
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2009153057A Active JP5085611B2 (en) | 2009-06-27 | 2009-06-27 | Computer program that transitions between real and virtual environments |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP5085611B2 (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP5998566B2 (en) * | 2012-03-27 | 2016-09-28 | 富士通株式会社 | Movement control program, movement control method, and control apparatus |
JP5756144B2 (en) * | 2013-04-22 | 2015-07-29 | レノボ・シンガポール・プライベート・リミテッド | Operating system management method, computer program, and computer |
JP6462540B2 (en) * | 2015-09-08 | 2019-01-30 | 株式会社東芝 | Driver device, information processing system, program, and method |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JP3943865B2 (en) * | 2001-06-05 | 2007-07-11 | 株式会社日立製作所 | Computer apparatus and diagnostic method |
-
2009
- 2009-06-27 JP JP2009153057A patent/JP5085611B2/en active Active
Also Published As
Publication number | Publication date |
---|---|
JP2011008646A (en) | 2011-01-13 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
JP6530774B2 (en) | Hardware failure recovery system | |
KR101019937B1 (en) | Secure operating system switching | |
US8423811B2 (en) | Transparently increasing power savings in a power management environment | |
TWI656479B (en) | Migrating threads between asymmetric cores in a multiple core processor | |
US8752060B2 (en) | Multi-CPU domain mobile electronic device and operation method thereof | |
US8898495B2 (en) | Method and apparatus for switching an operating system by determining whether a boot-up mode is a general mode or a switch mode | |
US20060085794A1 (en) | Information processing system, information processing method, and program | |
Sun et al. | SecureSwitch: BIOS-Assisted Isolation and Switch between Trusted and Untrusted Commodity OSes. | |
KR101646425B1 (en) | Switching between operational contexts | |
KR102026217B1 (en) | Techniques for switching between operating systems | |
JP2004326749A (en) | Device and method for dynamically switching multithread processor between single thread mode and simultaneous multithread mode | |
JP5756144B2 (en) | Operating system management method, computer program, and computer | |
US20190004818A1 (en) | Method of UEFI Shell for Supporting Power Saving Mode and Computer System thereof | |
EP2972826B1 (en) | Multi-core binary translation task processing | |
JP5085611B2 (en) | Computer program that transitions between real and virtual environments | |
US9910677B2 (en) | Operating environment switching between a primary and a secondary operating system | |
Sun et al. | Supporting Multiple OSes with OS Switching. | |
US20180341482A1 (en) | Method and arrangement for utilization of a processing arrangement | |
US20240248702A1 (en) | Firmware update technologies | |
US20240028222A1 (en) | Sleep mode using shared memory between two processors of an information handling system | |
JP2014531099A (en) | Switching operating context | |
Chuang et al. | Modified Packing Algorithm for Dynamic Energy-Saving in Cloud Computing Servers | |
JP2014146142A (en) | Method of controlling power state of storage device including rotary disk, and portable computer |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20110225 |
|
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: 20120904 |
|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20120905 |
|
R150 | Certificate of patent or registration of utility model |
Ref document number: 5085611 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 Free format text: JAPANESE INTERMEDIATE CODE: R150 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20150914 Year of fee payment: 3 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |