QEMU Support for the RISC-V Instruction Set Architecture
Sagar Karandikar sagark@eecs.berkeley.edu KVM Forum 2016 https://github.com/riscv/riscv-qemu
QEMU Support for the RISC-V Instruction Set Architecture Sagar - - PowerPoint PPT Presentation
QEMU Support for the RISC-V Instruction Set Architecture Sagar Karandikar sagark@eecs.berkeley.edu KVM Forum 2016 https://github.com/riscv/riscv-qemu Outline Why RISC-V? Benefits of an Open ISA RISC-V ISA Basics Virtualization
Sagar Karandikar sagark@eecs.berkeley.edu KVM Forum 2016 https://github.com/riscv/riscv-qemu
due to:
+ In a system, there are also displays, radios, DC/DC converters, sensors, actuators…
Intel)
ISA is the most important interface in a computer system where software meets hardware
NVIDIA Tegra SoC
there is no good technical reason for the lack of free, open ISAs
competent ISA
designers, closed-source and open-source
reuse, fewer errors given more eyeballs
expand the Internet of Things (IoTs), which could cost as little as $1
embedded in concrete 50 years ago
hardware and software stacks
x86 as basis of research, it was time for the Computer Science team at UC Berkeley to look at what ISAs to use for their next set of projects
x86 as basis of research, it was time for the Computer Science team at UC Berkeley to look at what ISAs to use for their next set of projects
develop their own clean-slate ISA
designers
user spec
fifth major RISC ISA design effort at UC Berkeley
publications dating back to 1981
profit RISC-V Foundation to govern the ISA
sure software can be reused across many chip designs
implementations of the RISC-V ISA specification
Raven-1 Raven-2 Raven-3 Raven-4 EOS14 EOS16 EOS18 EOS20 2011 2012 2013 2014 2015 May Apr Aug Feb Jul Sep Mar Nov Mar EOS: IBM 45nm SOI Raven: ST 28nm FDSOI Hurricane: ST 28nm FDSOI SWERVE: TSMC 28nm SWERVE EOS22 EOS24
1GHz 50+ DP GFLOPS/W
1.65GHz 14 DP GFLOPS/W
Hurricane-1 2016
Rumble Development
defined
OS, etc.
floating-point
Berkeley so far (45nm, 28nm)
format
implemented in QEMU
when only using U + S + M modes
virtualization techniques, where a guest OS is run at user-level, as the few privileged instructions can be easily detected and trapped.” – RISC-V Privileged Architecture v1.9 Manual
the x86 architecture that unfortunately violated Popek and Goldberg’s rule and hence made the x86 non-virtualizeable”1
state (Control Status Registers, or CSRs)
with the Original VMware Workstation. ACM Trans. Comput. Syst. 30, 4, Article 12 (November 2012), 51 pages.
contain the address of segment descriptor tables and page tables ... but regular load and store instructions can access these structures in memory.”1
management state
memory management state
with the Original VMware Workstation. ACM Trans. Comput. Syst. 30, 4, Article 12 (November 2012), 51 pages.
segment descriptor tables and segment registers, with visible and hidden fields. Hidden pieces updated by instructions or faults. Causes problems with extra faults introduced by a VMM.1
with the Original VMware Workstation. ACM Trans. Comput. Syst. 30, 4, Article 12 (November 2012), 51 pages.
Application Binary Interface (ABI)
Interface (SBI)
Execution Environment (HEE)
Application ABI AEE Application ABI OS SBI SEE Application ABI SBI Hypervisor Application ABI OS Application ABI Application ABI OS Application ABI SBI HBI HEE
physical resource partitioning, can act as simple hypervisor
dev@groups.riscv.org mailing list
Simulator
Machine)
github.com/riscv and github.com/ucb-bar
Spike QEMU
2014 2015 2016 riscv-qemu Work Started 1st Linux Boot
Fastest RISC-V Implementation 1st RISC-V Implementation w/ TCP/IP Networking 1st Python Bringup on RISC-V 1st Java Bringup on RISC-V (Hotspot Zero JVM) 1st RISC-V Core Built
System with Chisel
Execute Stage
br_ltu? PC addr ir[31:12] JumpReg TargGen Op2Sel Op1Sel AluFun data wa wd en addr data UType Note: for simplicity, the CSR File (control and status registers) and associated datapath is not shownRISC-V Sodor 1-Stage
exception SType Sign Extend ir[31:20] PC rs2 rs1 rs2Build screenshot courtesy Michael Knyszek
2014 2015 2016 riscv-qemu Work Started 1st Linux Boot
Fastest RISC-V Implementation 1st RISC-V Implementation w/ TCP/IP Networking 1st Python Bringup on RISC-V 1st Java Bringup on RISC-V (Hotspot Zero JVM) 1st RISC-V Core Built
System with Chisel QEMU RISC-V
1.7 Bump QEMU RISC-V
1.9 Bump Upstreaming Begins
1st RISC-V System w/Remote GDB
mode emulation code with Spike
match Spike
standard console device for early boot)
Emulation
privileged specification
0x8000_0000 0x0000_0000 0x0000_1000 0x4000_0000 ... DRAM ...
Reset Vector RTC Timers DRAM Base DRAM Top SoftInt Emu. Base + Size High
console, signaling test completion
draft Debug Unit specification (will be standardized)
move to standard devices as software support progresses
M-mode monitor U-mode system process S-mode OS Device 2 Interrupts Device 1 Interrupts Other Interrupts U-mode app
Binary supplied to QEMU contains:
System boots into hardcoded boot rom, jumps to bbl, bbl initializes the system in M-mode, sets up Supervisor Execution Environment (SEE), then loads and runs supplied kernel, e.g. Linux
parameters (% of mem instructions, floating point instructions, integer instructions, etc.)
V Specs
https://github.com/sagark/riscv-qemu-torture
GSoC
Sagar Karandikar sagark@eecs.berkeley.edu KVM Forum 2016 https://github.com/riscv/riscv-qemu