<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/">
  <channel>
    <title>Virtual_machine on Yuchen You</title>
    <link>https://www.whoami-wesleyyou.top/tags/virtual_machine/</link>
    <description>Recent content in Virtual_machine on Yuchen You</description>
    <generator>Hugo</generator>
    <language>zh-CN</language>
    <lastBuildDate>Tue, 23 Sep 2025 19:03:49 +0800</lastBuildDate>
    <atom:link href="https://www.whoami-wesleyyou.top/tags/virtual_machine/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>My VM is Lighter (and Safer) than your Container</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/23/computer_system_basics/os/historical/15.vm_lighter_than_container/</link>
      <pubDate>Tue, 23 Sep 2025 19:03:49 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/23/computer_system_basics/os/historical/15.vm_lighter_than_container/</guid>
      <description>&lt;h2 id=&#34;introduction&#34;&gt;Introduction&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;背景&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;容器(Docker/LXC)在工业界广泛应用: Google, AWS, Azure, GCP 都依赖容器;&lt;/li&gt;
&lt;li&gt;容器优势:
&lt;ul&gt;
&lt;li&gt;快速实例化(毫秒~百毫秒)&lt;/li&gt;
&lt;li&gt;高密度运行(单机可数千~上万实例)&lt;/li&gt;
&lt;li&gt;内存占用小, 镜像体积小&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;问题&lt;/strong&gt;
&lt;ul&gt;
&lt;li&gt;安全性不足:
&lt;ul&gt;
&lt;li&gt;容器暴露 &lt;strong&gt;400+ syscalls&lt;/strong&gt;, 内核攻击面巨大;&lt;/li&gt;
&lt;li&gt;隔离性不如 VM, 常需要&amp;quot;容器运行在 VM 内&amp;quot;来补强;&lt;/li&gt;
&lt;li&gt;资源滥用(fork bomb, 文件描述符耗尽)可导致宿主机 DoS;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;目标&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;结合容器的轻量性与 VM 的强隔离;&lt;/li&gt;
&lt;li&gt;需求:
&lt;ul&gt;
&lt;li&gt;毫秒级实例化&lt;/li&gt;
&lt;li&gt;高密度运行&lt;/li&gt;
&lt;li&gt;小镜像/低内存占用&lt;/li&gt;
&lt;li&gt;快速挂起/恢复&lt;/li&gt;
&lt;li&gt;保持 VM 的硬件隔离安全性&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;贡献&lt;/strong&gt;&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;分析 Xen 性能瓶颈, 重构控制面:
&lt;ul&gt;
&lt;li&gt;移除 XenStore (&lt;strong&gt;noxs&lt;/strong&gt;), 消除中心化瓶颈;&lt;/li&gt;
&lt;li&gt;新工具链 &lt;strong&gt;chaos/libchaos&lt;/strong&gt; + &lt;strong&gt;split toolstack&lt;/strong&gt;;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;提出 &lt;strong&gt;Tinyx&lt;/strong&gt; 工具, 生成极小 Linux VM; 支持 unikernel;&lt;/li&gt;
&lt;li&gt;实现 &lt;strong&gt;LightVM&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>The Turtles Project: Design and Implementation of Nested Virtualization</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/22/computer_system_basics/os/historical/14.turtle_IBM/</link>
      <pubDate>Mon, 22 Sep 2025 12:50:08 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/22/computer_system_basics/os/historical/14.turtle_IBM/</guid>
      <description>&lt;p&gt;Authors: Muli Ben-Yehuda et al., IBM Research / IBM Linux Technology Center&lt;/p&gt;
&lt;hr&gt;
&lt;h2 id=&#34;1-背景与动机&#34;&gt;1. 背景与动机&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;传统虚拟化 (single-level)&lt;/strong&gt;: 一个 hypervisor (L0) 管理多个 VM, 每个 VM 运行 OS;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;嵌套虚拟化 (nested virtualization)&lt;/strong&gt;: 允许一个 hypervisor (L1) 作为 guest 运行, 并且还能继续运行自己的 VM (L2);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;需求来源&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;现代操作系统自带虚拟化功能&lt;/strong&gt;(Windows XP mode in Win7, Linux 内置 KVM);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;IaaS 场景&lt;/strong&gt;: 云提供商 (L0) 希望用户能运行自己的 hypervisor (L1), 自己管理 VM (L2);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;研究和测试&lt;/strong&gt;: 嵌套虚拟化方便调试/benchmark hypervisor;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;安全性&lt;/strong&gt;: 可以研究/防御 hypervisor-level rootkit;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;iaas-infrastructure-as-a-service&#34;&gt;IaaS (Infrastructure as a Service)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;云计算三层服务之一: IaaS / PaaS / SaaS;&lt;/li&gt;
&lt;li&gt;IaaS = 提供虚拟化的计算资源(VM, 存储, 网络);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;例子&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;AWS EC2: 创业公司快速租用 VM, 按需扩展;&lt;/li&gt;
&lt;li&gt;Google Cloud GPU: 科研人员租用 A100 GPU VM;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;与论文关系: 云提供商必须支持 nested virtualization, 才能让用户在 VM 内运行自己的 hypervisor;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;2-虚拟化理论基础&#34;&gt;2. 虚拟化理论基础&lt;/h2&gt;
&lt;h3 id=&#34;popekgoldberg-1974&#34;&gt;Popek–Goldberg (1974)&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;三大条件&lt;/strong&gt;: 等价性 (equivalence), 资源控制 (resource control), 效率 (efficiency);&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;定理&lt;/strong&gt;: 如果架构中所有 &lt;strong&gt;sensitive 指令&lt;/strong&gt; 都是 &lt;strong&gt;privileged 指令&lt;/strong&gt;, 则该架构是可虚拟化的;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;影响&lt;/strong&gt;:
&lt;ul&gt;
&lt;li&gt;解释了早期 x86 &lt;strong&gt;不可完全虚拟化&lt;/strong&gt; $\rightarrow$ VMware 使用二进制翻译绕过;&lt;/li&gt;
&lt;li&gt;推动了 Intel/AMD 添加 VT-x / SVM 硬件扩展;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;3-两种嵌套虚拟化模型&#34;&gt;3. 两种嵌套虚拟化模型&lt;/h2&gt;
&lt;h3 id=&#34;1-multi-level-support&#34;&gt;1) Multi-level support&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;硬件直接支持多层 hypervisor;&lt;/li&gt;
&lt;li&gt;Trap 从 L2 直接交给 L1;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;例子&lt;/strong&gt;: IBM System z;&lt;/li&gt;
&lt;li&gt;高效, 但硬件设计复杂; 且一般多层的支持都是有限的, 如只支持两层, 这篇论文是在理论上支持任意层数的嵌套虚拟化, 因此更高层的虚拟化实际上还是依赖于单层虚拟化的软件支持逻辑: &lt;strong&gt;compress&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;h3 id=&#34;2-single-level-support&#34;&gt;2) Single-level support&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;硬件只有一层 root mode (L0);&lt;/li&gt;
&lt;li&gt;所有 trap(无论来自 L1, L2, L3)&lt;strong&gt;都掉到 L0&lt;/strong&gt;;&lt;/li&gt;
&lt;li&gt;L0 决定是否转发给 L1;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;例子&lt;/strong&gt;: x86 的 Intel VT-x (VMX), AMD SVM;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Multiplexing single-level&lt;/strong&gt;: L0 将唯一的一层虚拟化能力&amp;quot;复用&amp;quot;, 对上层 L1/L2 进行模拟;&lt;/li&gt;
&lt;/ul&gt;
&lt;hr&gt;
&lt;h2 id=&#34;4-cpu-虚拟化-vmx&#34;&gt;4. CPU 虚拟化 (VMX)&lt;/h2&gt;
&lt;h3 id=&#34;vmx--l0&#34;&gt;VMX &amp;amp; L0&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;VMX&lt;/strong&gt; = Intel VT-x 的指令扩展集;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;L0&lt;/strong&gt; = 唯一运行在 VMX root mode 的 hypervisor;&lt;/li&gt;
&lt;li&gt;所有 VMExit/VMEntry 都必须经过 L0;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;Trap 流程&lt;/strong&gt;: Single-level support: L2 trap $\rightarrow$ L0 trap handler $\rightarrow$ L0 转发给 L1;&lt;/p&gt;</description>
    </item>
    <item>
      <title>A Comparison of Software and Hardware Techniques for x86 Virtualization</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/21/computer_system_basics/os/historical/13.x86virt_comp/</link>
      <pubDate>Sun, 21 Sep 2025 20:22:43 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/21/computer_system_basics/os/historical/13.x86virt_comp/</guid>
      <description>&lt;p&gt;The main technical contributions of this paper are:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;a review of VMware Workstation&amp;rsquo;s software VMM, focusing on performance properties of the virtual instruction execution engine;&lt;/li&gt;
&lt;li&gt;a review of the emerging hardware support, identifying performance trade-offs;&lt;/li&gt;
&lt;li&gt;a quantitative performance comparison of a software and a hardware VMM.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Establishes &lt;strong&gt;three essential characteristics&lt;/strong&gt; for system software to be considered a VMM&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;Fidelity(保真性)&lt;/strong&gt; Software on the VMM executes identically to its execution on hardware, barring timing effects.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Performance(高性能)&lt;/strong&gt; An overwhelming majority of guest instructions are executed by the hardware without the intervention of the VMM.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Safety(安全性)&lt;/strong&gt; The VMM manages all hardware resources.&lt;/li&gt;
&lt;/ol&gt;
&lt;h2 id=&#34;1-基础概念&#34;&gt;1. 基础概念&lt;/h2&gt;
&lt;h3 id=&#34;vmm-vs-hypervisor&#34;&gt;VMM vs Hypervisor&lt;/h3&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;VMM (Virtual Machine Monitor)&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;来自 Popek &amp;amp; Goldberg (1974), 强调核心虚拟化功能(trap &amp;amp; emulate, BT, shadow structures);&lt;/li&gt;
&lt;li&gt;负责虚拟机执行控制;&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Hypervisor&lt;/strong&gt;:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;工程上更常用的术语, 指整个虚拟化层;&lt;/li&gt;
&lt;li&gt;包含 VMM, 同时提供调度, 资源分配, 设备模型, 管理接口;&lt;/li&gt;
&lt;li&gt;Type 1(bare-metal, 如 Xen, ESXi), Type 2(hosted, 如 VMware Workstation);&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;</description>
    </item>
    <item>
      <title>Xen and the Art of Virtualization</title>
      <link>https://www.whoami-wesleyyou.top/2025/09/15/computer_system_basics/os/historical/12.xen/</link>
      <pubDate>Mon, 15 Sep 2025 20:16:57 +0800</pubDate>
      <guid>https://www.whoami-wesleyyou.top/2025/09/15/computer_system_basics/os/historical/12.xen/</guid>
      <description>&lt;h2 id=&#34;背景&#34;&gt;背景&lt;/h2&gt;
&lt;p&gt;应用设计需要一个稳定的环境, 而传统的 OS 隔离技术不足以支持这种要求, 比如一个程序消耗了大量的算力并且被 scheduler 赋予了非常高的优先级, 或者系统被程序攻击了, 从而被某个其他进程消耗了很多资源导致当前进程的性能受损, 因此需要更高层的 VM 设计来实现工业界需要的 isolation 级别&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
