History log of /openbmc/qemu/target/riscv/ (Results 601 – 625 of 1666)
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
0af3f11523-Feb-2023 Weiwei Li <liweiwei@iscas.ac.cn>

target/riscv: Add *envcfg.HADE related check in address translation

When menvcfg.HADE is 1, hardware updating of PTE A/D bits is enabled
during single-stage address translation. When the hypervisor

target/riscv: Add *envcfg.HADE related check in address translation

When menvcfg.HADE is 1, hardware updating of PTE A/D bits is enabled
during single-stage address translation. When the hypervisor extension is
implemented, if menvcfg.HADE is 1, hardware updating of PTE A/D bits is
enabled during G-stage address translation.

Set *envcfg.HADE default true for backward compatibility.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230224040852.37109-6-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

7a6613da23-Feb-2023 Weiwei Li <liweiwei@iscas.ac.cn>

target/riscv: Add *envcfg.PBMTE related check in address translation

menvcfg.PBMTE bit controls whether the Svpbmt extension is available
for use in S-mode and G-stage address translation.

henvcfg.

target/riscv: Add *envcfg.PBMTE related check in address translation

menvcfg.PBMTE bit controls whether the Svpbmt extension is available
for use in S-mode and G-stage address translation.

henvcfg.PBMTE bit controls whether the Svpbmt extension is available
for use in VS-stage address translation.

Set *envcfg.PBMTE default true for backward compatibility.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230224040852.37109-5-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

0d190bd323-Feb-2023 Weiwei Li <liweiwei@iscas.ac.cn>

target/riscv: Add csr support for svadu

Add ext_svadu property
Add HADE field in *envcfg:
* menvcfg.HADE is read-only zero if Svadu is not implemented.
* henvcfg.HADE is read-only zero if menvcfg.HA

target/riscv: Add csr support for svadu

Add ext_svadu property
Add HADE field in *envcfg:
* menvcfg.HADE is read-only zero if Svadu is not implemented.
* henvcfg.HADE is read-only zero if menvcfg.HADE is zero.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230224040852.37109-4-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

6f3eb1a323-Feb-2023 Weiwei Li <liweiwei@iscas.ac.cn>

target/riscv: Fix the relationship of PBMTE/STCE fields between menvcfg and henvcfg

henvcfg.PBMTE/STCE are read-only zero if menvcfg.PBMTE/STCE are zero.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac

target/riscv: Fix the relationship of PBMTE/STCE fields between menvcfg and henvcfg

henvcfg.PBMTE/STCE are read-only zero if menvcfg.PBMTE/STCE are zero.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230224040852.37109-3-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

73ec0ead23-Feb-2023 Weiwei Li <liweiwei@iscas.ac.cn>

target/riscv: Fix the relationship between menvcfg.PBMTE/STCE and Svpbmt/Sstc extensions

menvcfg.PBMTE/STCE are read-only zero if Svpbmt/Sstc are not implemented.

Signed-off-by: Weiwei Li <liweiwei

target/riscv: Fix the relationship between menvcfg.PBMTE/STCE and Svpbmt/Sstc extensions

menvcfg.PBMTE/STCE are read-only zero if Svpbmt/Sstc are not implemented.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Daniel Henrique Barboza <dbarboza@ventanamicro.com>
Message-ID: <20230224040852.37109-2-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...


/openbmc/qemu/MAINTAINERS
/openbmc/qemu/accel/kvm/kvm-all.c
/openbmc/qemu/accel/tcg/cpu-exec.c
/openbmc/qemu/accel/tcg/internal.h
/openbmc/qemu/accel/tcg/meson.build
/openbmc/qemu/accel/tcg/monitor.c
/openbmc/qemu/accel/tcg/tcg-accel-ops.c
/openbmc/qemu/accel/tcg/tcg-all.c
/openbmc/qemu/accel/tcg/translate-all.c
/openbmc/qemu/accel/tcg/translator.c
/openbmc/qemu/accel/tcg/user-exec-stub.c
/openbmc/qemu/accel/xen/xen-all.c
/openbmc/qemu/block/vvfat.c
/openbmc/qemu/configure
/openbmc/qemu/cpu.c
/openbmc/qemu/docs/devel/testing.rst
/openbmc/qemu/docs/meson.build
/openbmc/qemu/dump/dump-hmp-cmds.c
/openbmc/qemu/dump/dump.c
/openbmc/qemu/dump/meson.build
/openbmc/qemu/dump/win_dump.c
/openbmc/qemu/dump/win_dump.h
/openbmc/qemu/gdbstub/gdbstub.c
/openbmc/qemu/hw/acpi/ich9.c
/openbmc/qemu/hw/acpi/ich9_tco.c
/openbmc/qemu/hw/arm/sbsa-ref.c
/openbmc/qemu/hw/audio/ac97.c
/openbmc/qemu/hw/audio/ac97.h
/openbmc/qemu/hw/audio/cs4231a.c
/openbmc/qemu/hw/audio/es1370.c
/openbmc/qemu/hw/audio/gus.c
/openbmc/qemu/hw/audio/hda-codec.c
/openbmc/qemu/hw/audio/sb16.c
/openbmc/qemu/hw/block/fdc-isa.c
/openbmc/qemu/hw/core/ptimer.c
/openbmc/qemu/hw/core/qdev.c
/openbmc/qemu/hw/display/sm501.c
/openbmc/qemu/hw/dma/i82374.c
/openbmc/qemu/hw/hppa/machine.c
/openbmc/qemu/hw/i2c/smbus_ich9.c
/openbmc/qemu/hw/i386/acpi-build.c
/openbmc/qemu/hw/i386/kvm/ioapic.c
/openbmc/qemu/hw/i386/microvm.c
/openbmc/qemu/hw/i386/pc.c
/openbmc/qemu/hw/i386/pc_piix.c
/openbmc/qemu/hw/i386/pc_q35.c
/openbmc/qemu/hw/i386/x86.c
/openbmc/qemu/hw/i386/xen/xen_platform.c
/openbmc/qemu/hw/ide/ahci.c
/openbmc/qemu/hw/ide/atapi.c
/openbmc/qemu/hw/ide/cmd646.c
/openbmc/qemu/hw/ide/core.c
/openbmc/qemu/hw/ide/ich.c
/openbmc/qemu/hw/ide/ioport.c
/openbmc/qemu/hw/ide/isa.c
/openbmc/qemu/hw/ide/macio.c
/openbmc/qemu/hw/ide/microdrive.c
/openbmc/qemu/hw/ide/mmio.c
/openbmc/qemu/hw/ide/pci.c
/openbmc/qemu/hw/ide/piix.c
/openbmc/qemu/hw/ide/qdev.c
/openbmc/qemu/hw/ide/sii3112.c
/openbmc/qemu/hw/ide/trace-events
/openbmc/qemu/hw/ide/via.c
/openbmc/qemu/hw/intc/apic.c
/openbmc/qemu/hw/intc/i8259.c
/openbmc/qemu/hw/intc/ioapic.c
/openbmc/qemu/hw/intc/ioapic_common.c
/openbmc/qemu/hw/intc/ioapic_internal.h
/openbmc/qemu/hw/isa/i82378.c
/openbmc/qemu/hw/isa/isa-bus.c
/openbmc/qemu/hw/isa/lpc_ich9.c
/openbmc/qemu/hw/isa/piix4.c
/openbmc/qemu/hw/isa/vt82c686.c
/openbmc/qemu/hw/mips/jazz.c
/openbmc/qemu/hw/misc/macio/gpio.c
/openbmc/qemu/hw/nubus/nubus-device.c
/openbmc/qemu/hw/pci-bridge/i82801b11.c
/openbmc/qemu/hw/pci/pci.c
/openbmc/qemu/hw/ppc/pnv_lpc.c
/openbmc/qemu/hw/ppc/prep.c
/openbmc/qemu/hw/ppc/sam460ex.c
/openbmc/qemu/hw/rtc/m48t59-isa.c
/openbmc/qemu/hw/rtc/mc146818rtc.c
/openbmc/qemu/hw/sh4/r2d.c
/openbmc/qemu/hw/sparc64/sun4u.c
/openbmc/qemu/hw/timer/hpet.c
/openbmc/qemu/hw/usb/dev-smartcard-reader.c
/openbmc/qemu/hw/usb/hcd-ohci.c
/openbmc/qemu/hw/usb/hcd-ohci.h
/openbmc/qemu/hw/usb/hcd-uhci.c
/openbmc/qemu/hw/usb/hcd-uhci.h
/openbmc/qemu/hw/usb/hcd-xhci-nec.c
/openbmc/qemu/hw/usb/trace-events
/openbmc/qemu/hw/usb/u2f.h
/openbmc/qemu/include/exec/gen-icount.h
/openbmc/qemu/include/exec/replay-core.h
/openbmc/qemu/include/hw/acpi/ich9.h
/openbmc/qemu/include/hw/core/cpu.h
/openbmc/qemu/include/hw/i386/x86.h
/openbmc/qemu/include/hw/ide.h
/openbmc/qemu/include/hw/ide/internal.h
/openbmc/qemu/include/hw/ide/isa.h
/openbmc/qemu/include/hw/ide/mmio.h
/openbmc/qemu/include/hw/ide/pci.h
/openbmc/qemu/include/hw/intc/i8259.h
/openbmc/qemu/include/hw/intc/ioapic.h
/openbmc/qemu/include/hw/isa/i8259_internal.h
/openbmc/qemu/include/hw/isa/isa.h
/openbmc/qemu/include/hw/isa/superio.h
/openbmc/qemu/include/hw/qdev-core.h
/openbmc/qemu/include/hw/rtc/mc146818rtc.h
/openbmc/qemu/include/hw/southbridge/ich9.h
/openbmc/qemu/include/hw/timer/i8254.h
/openbmc/qemu/include/hw/timer/i8254_internal.h
/openbmc/qemu/include/qemu/typedefs.h
/openbmc/qemu/include/sysemu/cpus.h
/openbmc/qemu/include/sysemu/kvm.h
/openbmc/qemu/include/sysemu/replay.h
/openbmc/qemu/meson_options.txt
/openbmc/qemu/qom/object_interfaces.c
/openbmc/qemu/scripts/checkpatch.pl
/openbmc/qemu/scripts/make-config-poison.sh
/openbmc/qemu/scripts/meson-buildoptions.sh
/openbmc/qemu/softmmu/meson.build
/openbmc/qemu/softmmu/physmem.c
/openbmc/qemu/softmmu/vl.c
/openbmc/qemu/softmmu/watchpoint.c
/openbmc/qemu/stubs/replay.c
/openbmc/qemu/target/i386/cpu.c
/openbmc/qemu/target/i386/cpu.h
/openbmc/qemu/target/i386/kvm/kvm.c
/openbmc/qemu/target/i386/tcg/emit.c.inc
/openbmc/qemu/target/i386/whpx/whpx-all.c
csr.c
/openbmc/qemu/target/sparc/mmu_helper.c
/openbmc/qemu/target/tricore/cpu.h
/openbmc/qemu/target/xtensa/cpu.c
/openbmc/qemu/tcg/tcg-common.c
/openbmc/qemu/tcg/tcg-op-gvec.c
/openbmc/qemu/tcg/tcg.c
/openbmc/qemu/tests/docker/dockerfiles/alpine.docker
/openbmc/qemu/tests/docker/dockerfiles/centos8.docker
/openbmc/qemu/tests/docker/dockerfiles/fedora-win32-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/fedora-win64-cross.docker
/openbmc/qemu/tests/docker/dockerfiles/opensuse-leap.docker
/openbmc/qemu/tests/docker/dockerfiles/ubuntu2004.docker
/openbmc/qemu/tests/lcitool/libvirt-ci
/openbmc/qemu/tests/lcitool/mappings.yml
/openbmc/qemu/tests/lcitool/targets/centos-stream-8.yml
/openbmc/qemu/tests/lcitool/targets/opensuse-leap-153.yml
/openbmc/qemu/tests/qtest/tco-test.c
/openbmc/qemu/tests/tcg/i386/test-i386-bmi2.c
/openbmc/qemu/tests/unit/meson.build
/openbmc/qemu/tests/unit/ptimer-test-stubs.c
/openbmc/qemu/trace/meson.build
/openbmc/qemu/ui/cocoa.m
/openbmc/qemu/util/guest-random.c
b8e1f32c21-Feb-2023 Weiwei Li <liweiwei@iscas.ac.cn>

target/riscv: Add support for Zicond extension

The spec can be found in https://github.com/riscv/riscv-zicond.
Two instructions are added:
- czero.eqz: Moves zero to a register rd, if the condition

target/riscv: Add support for Zicond extension

The spec can be found in https://github.com/riscv/riscv-zicond.
Two instructions are added:
- czero.eqz: Moves zero to a register rd, if the condition rs2 is
equal to zero, otherwise moves rs1 to rd.
- czero.nez: Moves zero to a register rd, if the condition rs2 is
nonzero, otherwise moves rs1 to rd.

Signed-off-by: Weiwei Li <liweiwei@iscas.ac.cn>
Signed-off-by: Junqiang Wang <wangjunqiang@iscas.ac.cn>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
Message-ID: <20230221091009.36545-1-liweiwei@iscas.ac.cn>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

b7fa70e220-Feb-2023 Christoph Müllner <christoph.muellner@vrull.eu>

RISC-V: XTheadMemPair: Remove register restrictions for store-pair

The XTheadMemPair does not define any restrictions for store-pair
instructions (th.sdd or th.swd). However, the current code enforc

RISC-V: XTheadMemPair: Remove register restrictions for store-pair

The XTheadMemPair does not define any restrictions for store-pair
instructions (th.sdd or th.swd). However, the current code enforces
the restrictions that are required for load-pair instructions.
Let's fix this by removing this code.

Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230220095612.1529031-1-christoph.muellner@vrull.eu>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

ae9c326f20-Feb-2023 Shaobo Song <songshaobo@eswincomputing.com>

target/riscv: Fix checking of whether instruciton at 'pc_next' spans pages

This bug has a noticeable behavior of falling back to the main loop and
respawning a redundant translation block including

target/riscv: Fix checking of whether instruciton at 'pc_next' spans pages

This bug has a noticeable behavior of falling back to the main loop and
respawning a redundant translation block including a single instruction
when the end address of the compressive instruction is exactly on a page
boundary, and slows down running system performance.

Signed-off-by: Shaobo Song <songshaobo@eswincomputing.com>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-ID: <20230220072732.568-1-songshaobo@eswincomputing.com>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

fb5bd4dc28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Group all predicate() routines together

Move sstc()/sstc32() to where all predicate() routines live, and
smstateen_acc_ok() to near {read,write}_xenvcfg().

Signed-off-by: Bin Meng <bm

target/riscv: Group all predicate() routines together

Move sstc()/sstc32() to where all predicate() routines live, and
smstateen_acc_ok() to near {read,write}_xenvcfg().

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-19-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

9e83a35628-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Drop priv level check in mseccfg predicate()

riscv_csrrw_check() already does the generic privilege level check
hence there is no need to do the specific M-mode access check in
the mse

target/riscv: Drop priv level check in mseccfg predicate()

riscv_csrrw_check() already does the generic privilege level check
hence there is no need to do the specific M-mode access check in
the mseccfg predicate().

With this change debugger can access the mseccfg CSR anytime.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-18-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

e4e1f21628-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Allow debugger to access sstc CSRs

At present with a debugger attached sstc CSRs can only be accssed
when CPU is in M-mode, or configured correctly.

Fix it by adjusting their predicat

target/riscv: Allow debugger to access sstc CSRs

At present with a debugger attached sstc CSRs can only be accssed
when CPU is in M-mode, or configured correctly.

Fix it by adjusting their predicate() routine logic so that the
static config check comes before the run-time check, as well as
adding a debugger check.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-17-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

0308fc6228-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Allow debugger to access {h, s}stateen CSRs

At present {h,s}stateen CSRs are not reported in the CSR XML
hence gdb cannot access them.

Fix it by adjusting their predicate() routine lo

target/riscv: Allow debugger to access {h, s}stateen CSRs

At present {h,s}stateen CSRs are not reported in the CSR XML
hence gdb cannot access them.

Fix it by adjusting their predicate() routine logic so that the
static config check comes before the run-time check, as well as
adding a debugger check.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-16-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

ddb1074228-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Allow debugger to access seed CSR

At present seed CSR is not reported in the CSR XML hence gdb cannot
access it.

Fix it by adding a debugger check in its predicate() routine.

Signed-

target/riscv: Allow debugger to access seed CSR

At present seed CSR is not reported in the CSR XML hence gdb cannot
access it.

Fix it by adding a debugger check in its predicate() routine.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-15-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

fb517fdb28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Allow debugger to access user timer and counter CSRs

At present user timer and counter CSRs are not reported in the
CSR XML hence gdb cannot access them.

Fix it by adding a debugger c

target/riscv: Allow debugger to access user timer and counter CSRs

At present user timer and counter CSRs are not reported in the
CSR XML hence gdb cannot access them.

Fix it by adding a debugger check in their predicate() routine.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-14-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

7eac8f4128-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: gdbstub: Drop the vector CSRs in riscv-vector.xml

It's worth noting that the vector CSR predicate() has a similar
run-time check logic to the FPU CSR. With the previous patch our
gdbst

target/riscv: gdbstub: Drop the vector CSRs in riscv-vector.xml

It's worth noting that the vector CSR predicate() has a similar
run-time check logic to the FPU CSR. With the previous patch our
gdbstub can correctly report these vector CSRs via the CSR xml.

Commit 719d3561b269 ("target/riscv: gdb: support vector registers for rv64 & rv32")
inserted these vector CSRs in an ad-hoc, non-standard way in the
riscv-vector.xml. Now we can treat these CSRs no different from
other CSRs.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-13-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

a1f0083c28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: gdbstub: Turn on debugger mode before calling CSR predicate()

Since commit 94452ac4cf26 ("target/riscv: remove fflags, frm, and fcsr from riscv-*-fpu.xml")
the 3 FPU CSRs are removed f

target/riscv: gdbstub: Turn on debugger mode before calling CSR predicate()

Since commit 94452ac4cf26 ("target/riscv: remove fflags, frm, and fcsr from riscv-*-fpu.xml")
the 3 FPU CSRs are removed from the XML target decription. The
original intent of that commit was based on the assumption that
the 3 FPU CSRs will show up in the riscv-csr.xml so the ones in
riscv-*-fpu.xml are redundant. But unforuantely that is not true.
As the FPU CSR predicate() has a run-time check on MSTATUS.FS,
at the time when CSR XML is generated MSTATUS.FS is unset, hence
no FPU CSRs will be reported.

The FPU CSR predicate() already considered such a case of being
accessed by a debugger. All we need to do is to turn on debugger
mode before calling predicate().

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-12-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

04733fb028-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Avoid reporting odd-numbered pmpcfgX in the CSR XML for RV64

At present the odd-numbered PMP configuration registers for RV64 are
reported in the CSR XML by QEMU gdbstub. However these

target/riscv: Avoid reporting odd-numbered pmpcfgX in the CSR XML for RV64

At present the odd-numbered PMP configuration registers for RV64 are
reported in the CSR XML by QEMU gdbstub. However these registers do
not exist on RV64 so trying to access them from gdb results in 'E14'.

Move the pmpcfgX index check from the actual read/write routine to
the PMP CSR predicate() routine, so that non-existent pmpcfgX won't
be reported in the CSR XML for RV64.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-11-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

94e2970728-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Simplify getting RISCVCPU pointer from env

Use env_archcpu() to get RISCVCPU pointer from env directly.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@is

target/riscv: Simplify getting RISCVCPU pointer from env

Use env_archcpu() to get RISCVCPU pointer from env directly.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-10-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

77ad639c28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Simplify {read, write}_pmpcfg() a little bit

Use the register index that has already been calculated in the
pmpcfg_csr_{read,write} call.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
R

target/riscv: Simplify {read, write}_pmpcfg() a little bit

Use the register index that has already been calculated in the
pmpcfg_csr_{read,write} call.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-9-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

a7e407b328-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Use 'bool' type for read_only

The read_only variable is currently declared as an 'int', but it
should really be a 'bool'.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiw

target/riscv: Use 'bool' type for read_only

The read_only variable is currently declared as an 'int', but it
should really be a 'bool'.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-8-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

8c7feddd28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Coding style fixes in csr.c

Fix various places that violate QEMU coding style:

- correct multi-line comment format
- indent to opening parenthesis

Signed-off-by: Bin Meng <bmeng@tiny

target/riscv: Coding style fixes in csr.c

Fix various places that violate QEMU coding style:

- correct multi-line comment format
- indent to opening parenthesis

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-7-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

e17e2c7c28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: gdbstub: Do not generate CSR XML if Zicsr is disabled

There is no need to generate the CSR XML if the Zicsr extension
is not enabled.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Revie

target/riscv: gdbstub: Do not generate CSR XML if Zicsr is disabled

There is no need to generate the CSR XML if the Zicsr extension
is not enabled.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-6-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

28eb8bee28-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: gdbstub: Minor change for better readability

Use a variable 'base_reg' to represent cs->gdb_num_regs so that
the call to ricsv_gen_dynamic_vector_xml() can be placed in one
single line

target/riscv: gdbstub: Minor change for better readability

Use a variable 'base_reg' to represent cs->gdb_num_regs so that
the call to ricsv_gen_dynamic_vector_xml() can be placed in one
single line for better readability.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li <liweiwei@iscas.ac.cn>
Reviewed-by: LIU Zhiwei <zhiwei_liu@linux.alibaba.com>
Message-ID: <20230228104035.1879882-5-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

0ee3422528-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Use g_assert() for the predicate() NULL check

At present riscv_csrrw_check() checks the CSR predicate() against
NULL and throws RISCV_EXCP_ILLEGAL_INST if it is NULL. But this is
a pur

target/riscv: Use g_assert() for the predicate() NULL check

At present riscv_csrrw_check() checks the CSR predicate() against
NULL and throws RISCV_EXCP_ILLEGAL_INST if it is NULL. But this is
a pure software check, and has nothing to do with the emulation of
the hardware behavior, thus it is inappropriate to return illegal
instruction exception when software forgets to install the hook.

Change to use g_assert() instead.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li<liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-4-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

a5e0f68628-Feb-2023 Bin Meng <bmeng@tinylab.org>

target/riscv: Add some comments to clarify the priority policy of riscv_csrrw_check()

The priority policy of riscv_csrrw_check() was once adjusted in
commit eacaf4401956 ("target/riscv: Fix priority

target/riscv: Add some comments to clarify the priority policy of riscv_csrrw_check()

The priority policy of riscv_csrrw_check() was once adjusted in
commit eacaf4401956 ("target/riscv: Fix priority of csr related check in riscv_csrrw_check")
whose commit message says the CSR existence check should come before
the access control check, but the code changes did not agree with
the commit message, that the predicate() check actually came after
the read / write check.

In fact this was intentional. Add some comments there so that people
won't bother trying to change it without a solid reason.

Signed-off-by: Bin Meng <bmeng@tinylab.org>
Reviewed-by: Weiwei Li<liweiwei@iscas.ac.cn>
Message-ID: <20230228104035.1879882-3-bmeng@tinylab.org>
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>

show more ...

1...<<21222324252627282930>>...67