Design of the RISC-V Instruction Set Architecture笔记(chapter6)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/shuiliusheng/article/details/82691143

Design of the RISC-V Instruction Set Architecture笔记(chapter6)

A RISC-V Privileged Architecture
  1. 分开讨论RISC-V用户级ISA和特权体系结构的原因:

    • It allows the user ISA to be shared across a wide variety of systems.

    • It facilitates experimentation in privileged architectures.

      Researchers can devise and implement novel memory translation and protection schemes, new security features, and alternative I/O mechanisms without having to rewrite application code

    • It simplifies the implementation of full virtualization.

      Exposing privileged features to unprivileged software adds complexity to hardware-assisted virtualization, and can make classical virtualization impossible
      这里写图片描述

  2. RISC-V Privileged Software Interfaces

    • ABI:applications make requests of the operating system using a system-call convention defined in an application binary interface
    • Hypervisor是一种运行在物理服务器和操作系统之间的中间软件层,可允许多个操作系统和应用共享一套基础物理硬件,因此也可以看作是虚拟环境中的“元”操作系统,它可以协调访问服务器上的所有物理设备和虚拟机,也叫虚拟机监视器(Virtual Machine Monitor)
    • The term hypervisor is a variant of supervisor, a traditional term for the kernel of an operating system: the hypervisor is the supervisor of the supervisor
    • 在早期计算中,操作系统被称为supervisor。能够在其他操作系统上运行的操作系统被称为 hypervisor(这个术语是在 20 世纪 70 年代出现的)。 VMM 可以直接在底层硬件上运行,允许运行多个虚拟机(VM)。每个 VM 都可以运行一个自己私有操作系统的实例
    • OS通常和底层硬件直接交互,从而限制了实现的灵活性和可移植性。RPA(RISC-V Privileged Architecture)通过supervisor binary interface(SBI)抽象出支持操作系统的supervisor execution environment(SEE)。SEE可以是一个简单的具有原始的I/O抽象的boot loader,类似于PC的BIOS,或者是支持完全虚拟化I/O和内存系统的hypervisor,甚至是SBI级别的仿真器。
    • HBI:硬件和hypervisor execution environment之间的交互,通过一个hypervisor binary interface来完成。这种设计是为了简化递归虚拟化的实现
    • 对于RISC-V原生的硬件系统,最底层的执行环境和硬件的交互通过硬件抽象层(HAL)完成。HAL隔离了执行环境和硬件平台的实现细节,提高了执行环境软件的适用性
      这里写图片描述
  3. 特权的四个级别:为了最大限度的减少因为trap进入VMM的客户机指令数量和因此带来的虚拟化开销,需要以特权模式运行客户端操作系统。

    • User:最低级,应用程序可以正常执行
    • Supervisor:提供基本的异常处理和虚拟内存的支持,OS可以正常的执行
    • Hypervisor:用于托管虚拟机监视器的特权模式的占位符,目前尚未定义
    • Machine:可以自由访问所有硬件功能。
    • 前三种模式是可选的,最后一种是必须的。
  4. superpage:在RV32种,页表是两级的有1024个表项的二级页表,因此除了可以有4KB的页,也可以拥有4MB的页,称为megapages;在RV64中,有不同的页表组织形式,也有不同的虚拟地址空间大小,最简单的39位的模式,有一个三级的512个表项的页表,因此可以支持4KB,2MB,1GB的页面,1GB的页面称为gigapages

  5. Hypervisor Mode:提供对物理内存的虚拟化,因此Hypervisor mode将会提供一个额外的地址转换层,用于将supervisor的物理地址转换为hypervisor的物理地址

  6. Machine Mode:to abstract the hardware platform and provide any missing hardware features。例如:M-mode software emulates misaligned loads and stores, unbeknownst even to supervisor software. It also emulates the standard floating-point extensions when they are unimplemented in hardware

猜你喜欢

转载自blog.csdn.net/shuiliusheng/article/details/82691143
今日推荐