7e45a682 | 13-Feb-2019 |
Bastian Koppelmann <kbastian@mail.uni-paderborn.de> |
target/riscv: Convert RV64I load/store insns to decodetree
this splits the 64-bit only instructions into its own decode file such that we generate the decoder for these instructions only for the RIS
target/riscv: Convert RV64I load/store insns to decodetree
this splits the 64-bit only instructions into its own decode file such that we generate the decoder for these instructions only for the RISC-V 64 bit target.
Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Peer Adelt <peer.adelt@hni.uni-paderborn.de>
show more ...
|
c1000d4e | 13-Feb-2019 |
Bastian Koppelmann <kbastian@mail.uni-paderborn.de> |
target/riscv: Convert RV32I load/store insns to decodetree
Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bastian
target/riscv: Convert RV32I load/store insns to decodetree
Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Peer Adelt <peer.adelt@hni.uni-paderborn.de>
show more ...
|
3cca75a6 | 13-Feb-2019 |
Bastian Koppelmann <kbastian@mail.uni-paderborn.de> |
target/riscv: Convert RVXI branch insns to decodetree
Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Richard Henderson <richard.he
target/riscv: Convert RVXI branch insns to decodetree
Acked-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Signed-off-by: Peer Adelt <peer.adelt@hni.uni-paderborn.de>
show more ...
|
ff9f31d9 | 26-Jan-2019 |
Xi Wang <xi.wang@gmail.com> |
target/riscv: fix counter-enable checks in ctr()
Access to a counter in U-mode is permitted only if the corresponding bit is set in both mcounteren and scounteren. The current code ignores mcounter
target/riscv: fix counter-enable checks in ctr()
Access to a counter in U-mode is permitted only if the corresponding bit is set in both mcounteren and scounteren. The current code ignores mcounteren and checks scounteren only for U-mode access.
Signed-off-by: Xi Wang <xi.wang@gmail.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
f18637cd | 14-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Add misa runtime write support
This patch adds support for writing misa. misa is validated based on rules in the ISA specification. 'E' is mutually exclusive with all other extensions. 'D' d
RISC-V: Add misa runtime write support
This patch adds support for writing misa. misa is validated based on rules in the ISA specification. 'E' is mutually exclusive with all other extensions. 'D' depends on 'F' so 'D' bit is dropped if 'F' is not present. A conservative approach to consistency is taken by flushing the translation cache on misa writes. misa_mask is added to the CPU struct to store the original set of extensions.
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
d77c3401 | 14-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Add misa.MAFD checks to translate
Add misa checks for M, A, F and D extensions and if they are not present generate illegal instructions. This improves emulation accurary for harts with a li
RISC-V: Add misa.MAFD checks to translate
Add misa checks for M, A, F and D extensions and if they are not present generate illegal instructions. This improves emulation accurary for harts with a limited set of extensions.
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
db9f3fd6 | 14-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Add misa to DisasContext
gen methods should access state from DisasContext. Add misa field to the DisasContext struct and remove CPURISCVState argument from all gen methods.
Signed-off-by:
RISC-V: Add misa to DisasContext
gen methods should access state from DisasContext. Add misa field to the DisasContext struct and remove CPURISCVState argument from all gen methods.
Signed-off-by: Michael Clark <mjc@sifive.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
d75377bf | 14-Jan-2019 |
Alistair Francis <Alistair.Francis@wdc.com> |
RISC-V: Add priv_ver to DisasContext
The gen methods should access state from DisasContext. Add priv_ver field to the DisasContext struct.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
RISC-V: Add priv_ver to DisasContext
The gen methods should access state from DisasContext. Add priv_ver field to the DisasContext struct.
Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
fb738839 | 14-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Use riscv prefix consistently on cpu helpers
* Add riscv prefix to raise_exception function * Add riscv prefix to CSR read/write functions * Add riscv prefix to signal handler function * Add
RISC-V: Use riscv prefix consistently on cpu helpers
* Add riscv prefix to raise_exception function * Add riscv prefix to CSR read/write functions * Add riscv prefix to signal handler function * Add riscv prefix to get fflags function * Remove redundant declaration of riscv_cpu_init and rename cpu_riscv_init to riscv_cpu_init * rename riscv_set_mode to riscv_cpu_set_mode
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
7f2b5ff1 | 14-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Implement mstatus.TSR/TW/TVM
This adds the necessary minimum to support S-mode virtualization for priv ISA >= v1.10
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Fra
RISC-V: Implement mstatus.TSR/TW/TVM
This adds the necessary minimum to support S-mode virtualization for priv ISA >= v1.10
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Co-authored-by: Matthew Suozzo <msuozzo@google.com> Co-authored-by: Michael Clark <mjc@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
533b8f88 | 14-Jan-2019 |
Richard Henderson <richard.henderson@linaro.org> |
RISC-V: Mark mstatus.fs dirty
Modifed from Richard Henderson's patch [1] to integrate with the new control and status register implementation.
[1] https://lists.nongnu.org/archive/html/qemu-devel/2
RISC-V: Mark mstatus.fs dirty
Modifed from Richard Henderson's patch [1] to integrate with the new control and status register implementation.
[1] https://lists.nongnu.org/archive/html/qemu-devel/2018-03/msg07034.html
Note: the f* CSRs already mark mstatus.FS dirty using env->mstatus |= mstatus.FS so the bug in the first spin of this patch has been fixed in a prior commit.
Signed-off-by: Michael Clark <mjc@sifive.com> Reviewed-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Co-authored-by: Richard Henderson <richard.henderson@linaro.org> Co-authored-by: Michael Clark <mjc@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
a88365c1 | 04-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Implement existential predicates for CSRs
CSR predicate functions are added to the CSR table. mstatus.FS and counter enable checks are moved to predicate functions and two new predicates are
RISC-V: Implement existential predicates for CSRs
CSR predicate functions are added to the CSR table. mstatus.FS and counter enable checks are moved to predicate functions and two new predicates are added to check misa.S for s* CSRs and a new PMP CPU feature for pmp* CSRs.
Processors that don't implement S-mode will trap on access to s* CSRs and processors that don't implement PMP will trap on accesses to pmp* CSRs.
PMP checks are disabled in riscv_cpu_handle_mmu_fault when the PMP CPU feature is not present.
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
71877e29 | 04-Jan-2019 |
Michael Clark <mjc@sifive.com> |
RISC-V: Implement atomic mip/sip CSR updates
Use the new CSR read/modify/write interface to implement atomic updates to mip/sip.
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistai
RISC-V: Implement atomic mip/sip CSR updates
Use the new CSR read/modify/write interface to implement atomic updates to mip/sip.
Signed-off-by: Michael Clark <mjc@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
41fbbba7 | 25-Nov-2018 |
Mao Zhongyi <maozhongyi@cmss.chinamobile.com> |
riscv/cpu: use device_class_set_parent_realize
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Alistair Fra
riscv/cpu: use device_class_set_parent_realize
Signed-off-by: Mao Zhongyi <maozhongyi@cmss.chinamobile.com> Reviewed-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
71a150bc | 14-Dec-2018 |
Anup Patel <anup@brainfault.org> |
target/riscv/pmp.c: Fix pmp_decode_napot()
Currently, start and end address of a PMP region are not decoded correctly by pmp_decode_napot().
Let's say we have a 128KB PMP region with base address a
target/riscv/pmp.c: Fix pmp_decode_napot()
Currently, start and end address of a PMP region are not decoded correctly by pmp_decode_napot().
Let's say we have a 128KB PMP region with base address as 0x80000000. Now, the PMPADDRx CSR value for this region will be 0x20003fff.
The current pmp_decode_napot() implementation will decode PMPADDRx CSR as t1=14, base=0x100000000, and range=0x1ffff whereas it should have decoded PMPADDRx CSR as t1=14, base=0x80000000, and range=0x1fff.
This patch fixes the base value decoding in pmp_decode_napot() when PMPADDRx CSR is not -1 (i.e. 0xffffffffffffffff).
Signed-off-by: Anup Patel <anup@brainfault.org> Signed-off-by: Anup Patel <anup.patel@wdc.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
3502dc82 | 09-Nov-2018 |
Palmer Dabbelt <palmer@sifive.com> |
RISC-V: Respect fences for user-only emulators
Our current fence implementation ignores fences for the user-only configurations. This is incorrect but unlikely to manifest: it requires multi-thread
RISC-V: Respect fences for user-only emulators
Our current fence implementation ignores fences for the user-only configurations. This is incorrect but unlikely to manifest: it requires multi-threaded user-only code that takes advantage of the weakness in the host's memory model and can be inlined by TCG.
This patch simply treats fences the same way for all our emulators. I've given it to testing as I don't want to construct a test that would actually trigger the failure.
Our fence implementation has an additional deficiency where we map all RISC-V fences to full fences. Now that we have a formal memory model for RISC-V we can start to take advantage of the strength bits on our fence instructions. This requires a bit more though, so I'm going to split it out because the implementation is still correct without taking advantage of these weaker fences.
Thanks to Richard Henderson for pointing out both of the issues.
Signed-off-by: Palmer Dabbelt <palmer@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
show more ...
|
65737773 | 08-Nov-2018 |
Bastian Koppelmann <kbastian@mail.uni-paderborn.de> |
target/riscv: Fix sfence.vm/a both available in any priv version
sfence.vm has been replaced in priv v1.10 spec by sfence.vma.
Reported-by: Richard Henderson <richard.henderson@linaro.org> Signed-o
target/riscv: Fix sfence.vm/a both available in any priv version
sfence.vm has been replaced in priv v1.10 spec by sfence.vma.
Reported-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Bastian Koppelmann <kbastian@mail.uni-paderborn.de> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|
426f0348 | 05-Mar-2018 |
Michael Clark <mjc@sifive.com> |
RISC-V: Update CSR and interrupt definitions
* Add user-mode CSR defininitions. * Reorder CSR definitions to match the specification. * Change H mode interrupt comment to 'reserved'. * Remove unused
RISC-V: Update CSR and interrupt definitions
* Add user-mode CSR defininitions. * Reorder CSR definitions to match the specification. * Change H mode interrupt comment to 'reserved'. * Remove unused X_COP interrupt. * Add user-mode interrupts. * Remove erroneous until comments on machine mode interrupts. * Move together paging mode and page table bit definitions. * Move together interrupt and exception cause definitions.
Signed-off-by: Michael Clark <mjc@sifive.com> Reviewed-by: Alistair Francis <alistair.francis@wdc.com> Reviewed-by: Palmer Dabbelt <palmer@sifive.com> Signed-off-by: Alistair Francis <alistair.francis@wdc.com> Signed-off-by: Palmer Dabbelt <palmer@sifive.com>
show more ...
|