This repository was archived by the owner on Apr 13, 2019. It is now read-only.
Tags: riscvarchive/riscv-qemu
Tags
RISC-V Patches for 3.1-rc2 This pull request contains four patches that aren't really related to each other aside from all being bug fixes that I think should go in for 3.1.0: * The second half of Alistair's memory leak patch set that I missed last week. * A fix to make fclass.d availiable only on RV64IFD systems (without this it's availiable on RV32IFD systems, truncating the result). * A fix to make sfence.vm availiable only in priv-1.9.1, and sfence.vma only availiable in priv-1.10. * A change to respect fences in user-mode emulators, which were previously treated as NOPs. As usual, this builds and boot Linux for me. I don't think I have anything else planned for 3.1.0, but I may be wrong as things are a bit hectic this week.
A Single RISC-V Patch for 3.1-rc1 This tag contains a single patch that I'd like to target for rc1: a fix for a memory leak that was detected by static code analysis. There are still three patch sets that I'd like to try to get up for 3.1: * The patch set Basian just published that contains fixes for a pair of issues he found when converting our port to decodetree. * An as-of-yet-unwritten fix to the third issue that Basian pointed out. * A fix to our fflags bug, which is currently coupled to some CSR refactoring that I don't think is OK for 3.1. I'm at Plumbers next week (and I think Alistair is there too?), but I'll try to find a way to squeeze in as much as possible.
RISC-V Patches for the 3.1 Soft Freeze, Part 2 This tag contains a few simple patches that I'd like to target for the QEMU soft freeze. There's only one code change: a fix to our PMP implementation that avoids an internal truncation while computing a partial PMP read. I also have two updates to the MAINTAINERS file: one to add Alistair as a RISC-V maintainer, and one to add our newly created mailing list.
First RISC-V Patch Set for the 3.1 Soft Freeze This pull request contains a handful of patches that have been floating around various trees for a while but haven't made it upstream. These patches all appear quite safe. They're all somewhat independent from each other: * One refactors our IRQ management function to allow multiple interrupts to be raised an once. This patch has no functional difference. * Cleaning up the op_helper/cpu_helper split. This patch has no functional difference. * Updates to various constants to keep them in sync with the latest ISA specification and to remove some non-standard bits that snuck in. * A fix for a memory leak in the PLIC driver. * A fix to our device tree handling to avoid provinging a NULL string. I've given this my standard test: building the port, booting a Fedora root filesytem on the latest Linux tag, and then shutting down that image. Essentially I'm just following the QEMU RISC-V wiki page's instructions. Everything looks fine here. We have a lot more outstanding patches so I'll definately be submitting another PR for the soft freeze.
riscv: Connect PCIe and apply some misc patches Connect PCIe to the RISC-V virt machine and SiFive U machines. There are also some patches that I have cherry picked from Michael's RISC-V tree that are ready to be applied.
Add gdb xml register support. This allows gdb to read misa and set breakpoints. This is a work in progress, and has a number of obvious problems, incomplete csr support, wrong int reg size for rv32, etc.
SiFive CLIC (Core Level Interrupt Controller) test-beta1
- Implements draft clic-spec (20180728)
- Implements non-vectored mode and vectored mode
- Implements mode+level+priority configuration
- Implements mode+level+priority preemption model
- Seperated M-mode (mtvec) and S-mode (stvec) delivery
- CLIC supports backwards compatible CLINT mode for
legacy interrupts using MIE/MIP,SIE/SIP (irq < 16)
depending on mtvec (MTI,MSI) and stvec (STI,SSI)
- CLINT mode supports S-mode stimecmp{h} and ssip{h}
- QEMU CLINT/CLIC Test Cases
- https://github.com/michaeljclark/qemu-riscv-tests
- Adds two experimental machines
- SiFive Freedom E-Series with CLIC
- Implements M-mode CLINT/CLIC config memory map
- Parameters
- CLICINTBITS=4
- CLICCFGMBITS=0
- CLICCFGLBITS=4
- Invocation
- qemu-system-riscv{32,64} -machine sifive_ex
- SiFive Freedom U-Series with CLIC
- Implements M-mode and S-mode CLINT/CLIC memory map
- Parameters
- CLICINTBITS=8
- CLICCFGMBITS=2
- CLICCFGLBITS=4
- Invocation
- qemu-system-riscv{32,64} -machine sifive_ux
- CLIC combined CLINT/CLIC memory map
- M-Mode CLINT = 0x02000000
- msip = 0x02000000 + hartid * 4
- mtimecmp = 0x02004000 + hartid * 4
- mtime = 0x0200bff8
- S-Mode CLINT = 0x02020000
- M-mode CLIC = 0x02080000
- clicintip = 0x02080000 + hartid * 0x1000 + 0x000
- clicintie = 0x02080000 + hartid * 0x1000 + 0x400
- clicintcfg = 0x02080000 + hartid * 0x1000 + 0x800
- cliccfg = 0x02080000 + hartid * 0x1000 + 0xc00
- S-Mode CLIC = 0x020c0000
- clicintip = 0x020c0000 + hartid * 0x1000 + 0x000
- clicintie = 0x020c0000 + hartid * 0x1000 + 0x400
- clicintcfg = 0x020c0000 + hartid * 0x1000 + 0x800
- Adds CLIC interrupt tracing (`-d trace:riscv_trap,...`)
- riscv_trap # existing core interrupt tracing
- sifive_clic_cfg # CLIC global configuration
- sifive_clic_intcfg # CLIC interrupt configuration
- sifive_clic_intie # CliC interrupt enable
- sifive_clic_intip # CLIC interrupt pending
- sifive_clic_irq # CLIC irq entry
- Notes / Limitations
- Enforces clicintcfg writes based on cliccfg and mode
- Reads/writes to intcfg/intie/intip in lower mode MMIO
apetures are currently allowed. Access checks need to
be added to suppress writes and hardwire read reults to
zero for any entries that where mode < clicintcfg.mode
- Interrupts pending bits are writable by software.
Edge/Level configuration needs to be added to control
software access to interrupt pending bits
- Selective vectoring in non-vectored mode is unimplemented
- PLIC is currently not routed via the CLIC however pending
bits can be written by software to test pre-emption.
- mnxti/snxti sets mstatus flags but returns 0 (slow path).
The CLIC state is currenetly not accessible from target/riscv
as cpu implementations can't include anything from include/hw
so the CLIC state needs to be in a CPU accessible structure.
- Potential race condition if an interrupt is posted
before the CPU has received and processed an outstanding
interrupt due to env->exccode being overwritten.
Needs changes to the interface from the CLIC so that the
CPU interrupt handler pulls the highest priority interrupt
from the CLIC at the time it is woken up. This requires the
CLIC state to be accessible from the CPU similarly to mnxti
- CPU core changes are relatively intrusive. The CPU interrupt
handling requires some abstraction/hooks for a more modular
CLIC implementation. CLIC state needs to be attached to
the CPU, and accessible to the MMIO device with hooks in
riscv_cpu_exec_interrupt and riscv_cpu_do_interrupt
Changes since v0
- Fix array index calculation in sifive_clic_realize
- Raise CLIC_LEVEL_BITS to 8 and fix assertion
- Move CLIC parameterization constants to its header
Merge branch 'qemu-for-testing' into riscv-all
PreviousNext