Single-VM Virtualization 5 “In computing, virtualization (or virtualisation) is the creation of a virtual (rather than actual) version of something, such as a hardware platform, operating system (OS), storage device, or network resources.” ※virtualization: アメリカ英語 virtualisation: イギリス英語
“the creation of a virtual version of something” Interface v Virtual version of something Subject 仮想化前 Interface r Real version of something Interface v Virtualizing System Interface r Real version of something
Interface C Virtualizing System Interface X Object 抽象度低下 Subject Interface B Object Interface X Object Subject Interface A Virtualizing System Interface X Object
Gerald J. Popek and Robert P. Goldberg. Formal Requirements for Virtualizable Third Generation Architectures. Communications of the ACM 17, 7 (July 1974), 412-421.
𝑒𝑖 (𝑆𝑖 ) 𝑆𝑖 𝐶𝑟 𝑆𝑗 ′ 𝑒𝑖 ′(𝑆𝑖 ′) 𝑆𝑖 ′ 𝐶𝑣 𝑓(𝑆𝑖 ) 𝑓(𝑆𝑗 ) Virtualization is the construction of an isomorphism between a virtual machine and a real machine; 𝑒𝑖 ′ ∘ 𝑓 𝑆𝑖 = 𝑓 ∘ 𝑒𝑖 (𝑆𝑖 ) S: a machine state, C: the collection of machine states, 𝑆 ∈ 𝐶 e: an instruction sequence (a unary operator), I: the set of all the instruction sequences of finite length, 𝑒 ∈ 𝐼 Virtual Real [Popek et al. 1974]
は ABI Subject は Process Process VMを実現するソフトウェアの例 Digital FX!32(IA-32⇒Alpha) Cygwin(UNIX→Win), Wine(Win→UNIX) Java, Ruby, .NET framework, ... o 抽象度高,現実度低 • System VM Interface v は ISA Subject はアプリケーションとOS System VMを実現するソフトウェアの例 VMWare, Xen, VirtualBox, QEMU 2012/8/24 23 チュートリアル「仮想化技術最前線」 Single-VM Virtualization Process ABI Virtual Machine Software (App/OS) ISA Virtual Machine
1 ISA 1 VM 1: Virtual Machine 1 App/OS 2 ISA 1 VM 2: Virtual Machine 2 VMM: Virtual Machine Monitor (Virtualizing Software) ISA 1 Real Machine System VM Process VM Process ABI Virtual Machine ≒ Virtualizing Software Interface Real Machine
under the VMM should exhibit an effect identical with that demonstrated if the program had been run on the original machine directly, with the possible exception of differences caused by the availability of system resources and differences caused by timing dependencies.” • Efficiency “It demands that a statistically dominant subset of the virtual processor's instructions be executed directly by the real processor, with no software intervention by the VMM.” • Resource Control (1) it is not possible for a program running under it in the created environment to access any resource not explicitly allocated to it (2) it is possible under certain circumstances for the VMM to regain control of resources already allocated. 2012/8/24 31 チュートリアル「仮想化技術最前線」 Single-VM Virtualization [Popek et al. 1974]
r (Virtualizing Software) Subject = OS/App Interface v = ISA Object = Machine 仮想化技術の分類のまとめ 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 37 Resource Desktop Process VM Emulation Multi-VM Type II Virtualization Machine System VM VMM Type I Single-VM Interface v = Interface r
any conventional third generation computer, a virtual machine monitor may be constructed if the set of sensitive instructions for that computer is a subset of the set of privileged instructions. [Popek et al. 1974] Instructions Privileged User Sensitive 定理1 「sensitive」な命令が全て特権命令に含まれて いればVMMが構成できる.
Instructions システムレジスタを読み込む命令 o SGDT, SIDT, SLDT, SMSW, PUSHF (S: Store, F: Flag) システムレジスタを書き換えるがトラップされない命令 o POPF Protection System References システムレジスタの内容を参照する命令 o LAR, LSL, STR, VERR, VERW (L: Load from system registers, V: Verify) セグメントの特権レベルを参照する命令 o POP, PUSH, CALL, JMP, INT n, RET 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 45 John Scott Robin and Cynthia E. Irvine. Analysis of the Intel Pentium's Ability to Support a Secure Virtual Machine Monitor. In Proceedings of the 9th conference on USENIX Security Symposium, 2000.
o VMMに対するアクセス制御 データI/Oの変換 o 拡張機能の実現 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 70 VMM ハード ゲストOS Device Device Driver Device Mediator 監視 変換 制御I/O データI/O 拡張機能 2012/8/24 T. Shinagawa et al. BitVisor: A Thin Hypervisor for Enforcing I/O Device Security. In Proc. 2009 ACM International Conference on Virtual Execution Environments (VEE 2009), pp. 121-130, Mar. 2009. doi:10.1145/1508293.1508311
及び USB1.1/2.0を捕捉 AES-XTSで暗号化 ネットワークI/Oを捕捉・暗号化 NIC(Intel PRO 100/1000)を捕捉 IPSecでVPN接続 ICカードで鍵管理・認証 USB接続のカードリーダにアクセス PC/SC, CCIDプロトコル 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 73 ATA NIC USB ストレージ管理 ネットワーク管理 ID管理 Device Mediator ATA NIC USB ATA NIC USB セキュアVM VMM ハードウェア
o アンチウィルス,… カーネルレベルでも書けない 再起動すれば元に戻る 最終ラインでのディフェンス 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 74 Y. Chubachi, T, Shinagawa, K. Kato. Hypervisor-based Prevention of Persistent Rootkits. In Proc. 25th ACM Symposium On Applied Computing (ACM SAC 2010), pp. 214-220, Mar. 2010. doi:10.1145/1774088.1774131
o ディレクトリ構造 ファイルとセクタのマッピング を管理 o セマンティックギャップを克服 o 低オーバーヘッドで実現 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 75 ゲストOS Device Device Driver 拡張機能 ATA NIC USB 保護モジュール Device Mediator ATA ATA NIC USB VM VMM ハードウェア 保護ポリシー
ATAアクセスをAoEに変換 ATA over Ethernet パケットをネットワークへ転送 ディスクイメージをサーバで集中管理 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 77 ゲストOS Device Device Driver 拡張機能 ATA NIC USB ATA監視 NICアクセス ATA-AoE変換 Device Mediator ATA NIC NIC USB VM VMM ハードウェア ATA
利用可能なサーバの選択 IPsecでのコネクションを確立 IPアドレスの不整合などを吸収 TCP接続が切れない 切り替え時間は3秒程度 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 79 ゲストOS Device Device Driver 拡張機能 ATA NIC USB VPNクライアント ID管理 Device Mediator NIC ATA NIC USB セキュアVM VMM ハードウェア
計算コードからユーザを保護 計算コードによる不正アクセスを防止 • VMMでELFコードを受信 VMM内の保護ドメインで実行 ユーザは存在を感知しない 2012/8/24 チュートリアル「仮想化技術最前線」 Single-VM Virtualization 80 ゲストOS Device Device Driver 拡張機能 ATA NIC USB Device Mediator NIC ATA NIC USB VM VMM ハードウェア 保護ドメイン 計算コード (ELF)