今朝MLで飛んでいたが、RISC-VのPrivileged Instruction SetのVer1.7が公開されたようだ。
RISC-V Draft Privileged Architecture Version 1.7 Released | RISC-V BLOG
http://www.eecs.berkeley.edu/Pubs/TechRpts/2015/EECS-2015-49.pdf
55ページある。ユーザモードの命令仕様書が100ページくらいだから、まあそんな感じだろうか。
- Introduction
- Control and Status Registers (CSRs)
- Machine-Level ISA
- Supervisor-Level ISA
- Hypervisor-Level ISA
- RISC-V Privileged Instruction Set Listings
とりあえず概念的なところだけピックアップしていくと、まずは以下のような階層レイヤになっている。
(上記仕様書から抜粋)
権限は「ユーザモード」「スーパバイザモード」「ハイパーバイザーモード」「マシンモード」の4種類。後者になるほど権限が高くなる。
Although none are currently defined, future hypervisor-level ISA extensions will be added to improve virtualization performance. One common feature to support hypervisors is to provide a second level of translation and protection, from supervisor physical addresses to hypervisor physical addresses.
えー。でもまあ、とりあえず最低限の実装としてはマシンモードがあればよく、次にユーザモードを持っているのが良いらしい。
- レベル1: マシンモード
- レベル2: マシンモード、ユーザモード
- レベル3: マシンモード、スーパバイザモード、ユーザモード
- レベル4: マシンモード、ハイパーバイザモード、スーパバイザモード、ユーザモード