Re: [PATCH v2 01/13] target/riscv: Add properties for Indirect CSR Access extension

2024-07-26 Thread Alistair Francis
csrind, PRIV_VERSION_1_12_0, ext_smcsrind), This is actually part of the unpriv spec, so it's a bit weird that it depends on the priv spec. But that's how it's all set up. But shouldn't this be PRIV_VERSION_1_13_0? Alistair

Re: [PATCH] target/riscv: Add asserts for out-of-bound access

2024-07-25 Thread Alistair Francis
7d2f2 100644 > --- a/target/riscv/pmu.c > +++ b/target/riscv/pmu.c > @@ -204,6 +204,7 @@ static void riscv_pmu_icount_update_priv(CPURISCVState > *env, > } > > if (env->virt_enabled) { > +g_assert(env->priv <= PRV_S); Don't we need this assert for !env->virt_enabled as well? Alistair

Re: [PATCH-for-9.1] target/riscv: Remove the deprecated 'any' CPU type

2024-07-25 Thread Alistair Francis
ppe Mathieu-Daudé Reviewed-by: Alistair Francis Alistair > --- > docs/about/deprecated.rst | 13 - > docs/about/removed-features.rst | 8 > target/riscv/cpu-qom.h | 1 - > target/riscv/cpu.c | 28 >

Re: [PATCH v2 15/23] tests/functional: Convert the riscv_opensbi avocado test into a standalone test

2024-07-24 Thread Alistair Francis
ion per machine now. > > Signed-off-by: Thomas Huth Reviewed-by: Alistair Francis Alistair > --- > tests/avocado/riscv_opensbi.py | 63 -- > tests/functional/meson.build | 8 > tests/functional/test_riscv_opensbi.py | 36 +

Re: [PATCH v5 13/13] docs/specs: add riscv-iommu

2024-07-24 Thread Alistair Francis
On Wed, Jul 24, 2024 at 10:56 PM Daniel Henrique Barboza wrote: > > > > On 7/19/24 6:34 AM, Alistair Francis wrote: > > On Tue, Jul 9, 2024 at 3:37 AM Daniel Henrique Barboza > > wrote: > >> > >> Add a simple guideline to use the existi

Re: [PATCH qemu v2 1/1] target/riscv: Add Zilsd and Zcmlsd extension support

2024-07-23 Thread Alistair Francis
} > + > +TCGv data_low = get_gpr(ctx, a->rs2, EXT_NONE); > +TCGv data_high = get_gpr(ctx, a->rs2 + 1, EXT_NONE); > +TCGv addr = get_address(ctx, a->rs1, a->imm); > +TCGv_i64 tmp = tcg_temp_new_i64(); > + > +tcg_gen_concat_tl_i64(tmp, d

Re: [PATCH v6 0/8] target/riscv: Expose RV32 cpu to RV64 QEMU

2024-07-23 Thread Alistair Francis
> target/riscv: Correct SXL return value for RV32 in RV64 QEMU > target/riscv: Detect sxl to set bit width for RV32 in RV64 > target/riscv: Correct mcause/scause bit width for RV32 in RV64 QEMU > target/riscv: Enable RV32 CPU support in RV64 QEMU Tha

Re: [PATCH v3 0/2] RISC-V: Add preliminary textra trigger CSR functions

2024-07-23 Thread Alistair Francis
w > - Simplify writing of tdata3 > > Alvin Chang (2): > target/riscv: Preliminary textra trigger CSR writting support > target/riscv: Add textra matching condition for the triggers Thanks! Applied to riscv-to-apply.next Alistair > > tar

Re: [PATCH 1/1] target/riscv: Remove redundant insn length check for zama16b

2024-07-22 Thread Alistair Francis
them. > > > > Suggested-by: Alistair Francis > > Signed-off-by: LIU Zhiwei > > That is both false (trans_fld is used from trans_c_fld), and not the takeaway > you should > have gotten (the operation of "fld" should not depend on the encoding). > > Perhap

Re: [PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-22 Thread Alistair Francis
On Tue, Jul 23, 2024 at 9:33 AM Atish Kumar Patra wrote: > > On Sat, Jul 20, 2024 at 8:19 AM Peter Maydell > wrote: > > > > On Thu, 18 Jul 2024 at 03:15, Alistair Francis wrote: > > > > > > From: Atish Patra > > > > > > The timer is

Re: [PULL 05/30] target/riscv: Support Zama16b extension

2024-07-22 Thread Alistair Francis
On Thu, Jul 18, 2024 at 12:10 PM Alistair Francis wrote: > > From: LIU Zhiwei > > Zama16b is the property that misaligned load/stores/atomics within > a naturally aligned 16-byte region are atomic. > > According to the specification, Zama16b applies only to AMOs, loads

Re: [PATCH v2 1/2] target/riscv: Preliminary textra trigger CSR writting support

2024-07-19 Thread Alistair Francis
break; > +default: > + g_assert_not_reached(); > +} > + > +if (textra != tdata3) { > +qemu_log_mask(LOG_GUEST_ERROR, > + "different value 0x" TARGET_FMT_lx " write to > tdata3\n", > + textra); > +} You don't need this, you have already reported on all of the possible differences With the above removed Reviewed-by: Alistair Francis Alistair

Re: [PATCH v5 13/13] docs/specs: add riscv-iommu

2024-07-19 Thread Alistair Francis
:0014. > + > +To include the device in the 'virt' machine: > + > +.. code-block:: bash > + > + $ qemu-system-riscv64 -M virt -device riscv-iommu-pci (...) We should add a sentence saying what this does. As in what should a user expect after they have done this Alistair > + >

Re: [PATCH v5 12/13] qtest/riscv-iommu-test: add init queues test

2024-07-19 Thread Alistair Francis
ines for initialization". It emulates what we expect from the > software/OS when initializing the IOMMU. > > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Frank Chang Acked-by: Alistair Francis Alistair > --- > tests/qtest/libqos/riscv-iommu.h | 29 +++

Re: [PATCH v5 09/13] hw/riscv/riscv-iommu: add ATS support

2024-07-18 Thread Alistair Francis
ations. > > Signed-off-by: Tomasz Jeznach > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Frank Chang Acked-by: Alistair Francis Alistair > --- > hw/riscv/riscv-iommu-bits.h | 43 +++- > hw/riscv/riscv-iommu.c | 129 ++

Re: [PATCH v5 08/13] hw/riscv/riscv-iommu: add Address Translation Cache (IOATC)

2024-07-17 Thread Alistair Francis
s 'not implemented'. > > There are some artifacts included in the cache that predicts s-stage and > g-stage elements, although we don't support it yet. We'll introduce them > next. > > Signed-off-by: Tomasz Jeznach > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Frank Cha

Re: [PATCH v5 05/13] hw/riscv: add riscv-iommu-pci reference device

2024-07-17 Thread Alistair Francis
d-off-by: Tomasz Jeznach > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Frank Chang Reviewed-by: Alistair Francis Alistair > --- > hw/riscv/meson.build | 2 +- > hw/riscv/riscv-iommu-pci.c | 178 + > 2 files changed, 179 i

Re: [PATCH v5 03/13] hw/riscv: add RISC-V IOMMU base emulation

2024-07-17 Thread Alistair Francis
iltering - address pattern */ > +uint64_t msiptp;/* MSI redirection page table pointer */ > +}; > + > +/* IOMMU index for transactions without process_id specified. */ > +#define RISCV_IOMMU_NOPROCID 0 > + > +static void riscv_iommu_notify(RISCVIOMMUState *

[PULL 29/30] hw/riscv/virt.c: re-insert and deprecate 'riscv, delegate'

2024-07-17 Thread Alistair Francis
ation'") Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-ID: <20240715090455.145888-1-dbarb...@ventanamicro.com> Signed-off-by: Alistair Francis --- docs/about/deprecated.rst | 11 +++ hw/riscv/virt.c | 9 + 2 files changed, 20 ins

[PULL 15/30] target/riscv: Combine set_mode and set_virt functions.

2024-07-17 Thread Alistair Francis
te update codes. For example: One use-case which inspired this change is to update mode-specific instruction and cycle counters which requires information of both prev mode and current mode. Signed-off-by: Rajnesh Kanwal Reviewed-by: Alistair Francis Reviewed-by: Daniel Henrique Barboza Message-ID:

[PULL 27/30] target/riscv: Expose the Smcntrpmf config

2024-07-17 Thread Alistair Francis
From: Atish Patra Create a new config for Smcntrpmf extension so that it can be enabled/ disabled from the qemu commandline. Signed-off-by: Atish Patra Acked-by: Alistair Francis Message-ID: <20240711-smcntrpmf_v7-v8-13-b7c38ae7b...@rivosinc.com> Signed-off-by: Alistair Francis ---

[PULL 06/30] target/riscv: Move gen_amo before implement Zabha

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Acked-by: Alistair Francis Message-ID: <20240709113652.1239-7-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- target/riscv/translate.c| 21 + target/riscv/insn_trans/trans_rva.c.in

[PULL 26/30] target/riscv: Do not setup pmu timer if OF is disabled

2024-07-17 Thread Alistair Francis
. Reviewed-by: Daniel Henrique Barboza Signed-off-by: Atish Patra Message-ID: <20240711-smcntrpmf_v7-v8-12-b7c38ae7b...@rivosinc.com> Signed-off-by: Alistair Francis --- target/riscv/pmu.c | 56 -- 1 file changed, 44 insertions(+), 12 deletions(-) diff

[PULL 23/30] target/riscv: Enforce WARL behavior for scounteren/hcounteren

2024-07-17 Thread Alistair Francis
From: Atish Patra scounteren/hcountern are also WARL registers similar to mcountern. Only set the bits for the available counters during the write to preserve the WARL behavior. Signed-off-by: Atish Patra Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-ID

[PULL 14/30] target/riscv/kvm: update KVM regs to Linux 6.10-rc5

2024-07-17 Thread Alistair Francis
From: Daniel Henrique Barboza Two new regs added: ztso and zacas. Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-ID: <20240709085431.455541-1-dbarb...@ventanamicro.com> Signed-off-by: Alistair Francis --- target/riscv/kvm/kvm-cpu.c | 2 ++ 1 file chan

[PULL 28/30] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-07-17 Thread Alistair Francis
and will cause any attendant side effects. So if CSRRS or CSRRC tries to write a read-only CSR with rs1 which specifies a register holding a zero value, an illegal instruction exception should be raised. Signed-off-by: Yu-Ming Chang Signed-off-by: Alvin Chang Reviewed-by: Alistair Francis Message-ID

[PULL 07/30] target/riscv: Add AMO instructions for Zabha

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Acked-by: Alistair Francis Message-ID: <20240709113652.1239-8-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- target/riscv/cpu_cfg.h | 1 + target/riscv/insn32.decode | 20 +++ target

[PULL 12/30] target/riscv: Validate the mode in write_vstvec

2024-07-17 Thread Alistair Francis
From: Jiayi Li Base on the riscv-privileged spec, vstvec substitutes for the usual stvec. Therefore, the encoding of the MODE should also be restricted to 0 and 1. Signed-off-by: Jiayi Li Reviewed-by: Alistair Francis Reviewed-by: LIU Zhiwei Message-ID: <20240701022553.1982-1-l

[PULL 24/30] target/riscv: Start counters from both mhpmcounter and mcountinhibit

2024-07-17 Thread Alistair Francis
711-smcntrpmf_v7-v8-10-b7c38ae7b...@rivosinc.com> Signed-off-by: Alistair Francis --- target/riscv/csr.c | 75 -- target/riscv/pmu.c | 3 +- 2 files changed, 54 insertions(+), 24 deletions(-) diff --git a/target/riscv/csr.c b/target/riscv/csr.c

[PULL 09/30] target/riscv: Add amocas.[b|h] for Zabha

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Message-ID: <20240709113652.1239-10-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- target/riscv/insn32.decode | 2 ++ target/riscv/insn_trans/trans_rvzabha.c.in

[PULL 25/30] target/riscv: More accurately model priv mode filtering.

2024-07-17 Thread Alistair Francis
: <20240711-smcntrpmf_v7-v8-11-b7c38ae7b...@rivosinc.com> Signed-off-by: Alistair Francis --- target/riscv/pmu.h | 2 ++ target/riscv/csr.c | 5 - target/riscv/pmu.c | 30 +++--- 3 files changed, 33 insertions(+), 4 deletions(-) diff --git a/target/riscv/pmu.h b/target

[PULL 04/30] disas/riscv: Support zcmop disassemble

2024-07-17 Thread Alistair Francis
Zhiwei Acked-by: Alistair Francis Reviewed-by: Deepak Gupta Message-ID: <20240709113652.1239-5-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- disas/riscv.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/disas/riscv.c b/disas/riscv.c

[PULL 03/30] target/riscv: Add zcmop extension

2024-07-17 Thread Alistair Francis
to not write any register. In current implementation, C.MOP.n only has an check function, without any other more behavior. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Reviewed-by: Deepak Gupta Message-ID: <20240709113652.1239-4-zhiwei_...@linux.alibaba.com> Signed-off-by: Al

[PULL 05/30] target/riscv: Support Zama16b extension

2024-07-17 Thread Alistair Francis
operation for the purposes of RVWMO—i.e., it will execute atomically. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Message-ID: <20240709113652.1239-6-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- target/riscv/cpu_cfg.h | 1 + target/riscv

[PULL 30/30] roms/opensbi: Update to v1.5

2024-07-17 Thread Alistair Francis
SR b752099 include: sbi: Introduce common endianess conversion macro Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Message-ID: <20240715171521.179517-1-dbarb...@ventanamicro.com> Signed-off-by: Alistair Francis --- .../opensbi-riscv32-generic-fw_dynamic.bin| Bin 267416

[PULL 21/30] target/riscv: Implement privilege mode filtering for cycle/instret

2024-07-17 Thread Alistair Francis
to be enabled. The cycle/instret are still computed using host ticks when icount is not enabled. Otherwise, they are computed using raw icount which is more accurate in icount mode. Co-Developed-by: Rajnesh Kanwal Signed-off-by: Rajnesh Kanwal Reviewed-by: Daniel Henrique Barboza Acked-by: Alistair

[PULL 18/30] target/riscv: Add cycle & instret privilege mode filtering definitions

2024-07-17 Thread Alistair Francis
From: Kaiwen Xue This adds the definitions for ISA extension smcntrpmf. Signed-off-by: Kaiwen Xue Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Signed-off-by: Atish Patra Message-ID: <20240711-smcntrpmf_v7-v8-4-b7c38ae7b...@rivosinc.com> Signed-off-by: Alistair F

[PULL 22/30] target/riscv: Save counter values during countinhibit update

2024-07-17 Thread Alistair Francis
saved when the counter is stopped. Thus, save the value of the counter during the inhibit update operation and return that value during the read if corresponding bit in mcountihibit is set. Acked-by: Alistair Francis Reviewed-by: Daniel Henrique Barboza Signed-off-by: Atish Patra Message-ID

[PULL 16/30] target/riscv: Fix the predicate functions for mhpmeventhX CSRs

2024-07-17 Thread Alistair Francis
From: Atish Patra mhpmeventhX CSRs are available for RV32. The predicate function should check that first before checking sscofpmf extension. Fixes: 14664483457b ("target/riscv: Add sscofpmf extension support") Reviewed-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis

[PULL 20/30] target/riscv: Only set INH fields if priv mode is available

2024-07-17 Thread Alistair Francis
From: Atish Patra Currently, the INH fields are set in mhpmevent uncoditionally without checking if a particular priv mode is supported or not. Suggested-by: Alistair Francis Signed-off-by: Atish Patra Acked-by: Alistair Francis Message-ID: <20240711-smcntrpmf_v7-v8-6-b7c38a

[PULL 17/30] target/riscv: Add cycle & instret privilege mode filtering properties

2024-07-17 Thread Alistair Francis
From: Kaiwen Xue This adds the properties for ISA extension smcntrpmf. Patches implementing it will follow. Signed-off-by: Kaiwen Xue Reviewed-by: Daniel Henrique Barboza Signed-off-by: Atish Patra Reviewed-by: Alistair Francis Message-ID: <20240711-smcntrpmf_v7-v8-3-b7c38a

[PULL 13/30] disas/riscv: Add decode for Zawrs extension

2024-07-17 Thread Alistair Francis
From: Balaji Ravikumar Add disassembly support for these instructions from Zawrs: * wrs.sto * wrs.nto Signed-off-by: Balaji Ravikumar Signed-off-by: Rob Bradford Acked-by: Alistair Francis Message-ID: <20240705165316.127494-1-rbradf...@rivosinc.com> Signed-off-by: Alistair F

[PULL 01/30] target/riscv: Add zimop extension

2024-07-17 Thread Alistair Francis
and 7. These 40 MOPs initially are defined to simply write zero to x[rd], but are designed to be redefined by later extensions to perform some other action. Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Reviewed-by: Deepak Gupta Message-ID: <20240709113652.1239-2-zhiw

[PULL 10/30] target/riscv: Expose zabha extension as a cpu property

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Reviewed-by: Alistair Francis Message-ID: <20240709113652.1239-11-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- target/riscv/cpu.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/riscv/cpu.c b/target/riscv

[PULL 08/30] target/riscv: Move gen_cmpxchg before adding amocas.[b|h]

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Acked-by: Alistair Francis Message-ID: <20240709113652.1239-9-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- target/riscv/translate.c| 13 + target/riscv/insn_trans/trans_rvzacas.c.in

[PULL 02/30] disas/riscv: Support zimop disassemble

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Acked-by: Alistair Francis Reviewed-by: Deepak Gupta Message-ID: <20240709113652.1239-3-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- disas/riscv.c | 98 +++ 1 file chang

[PULL 19/30] target/riscv: Add cycle & instret privilege mode filtering support

2024-07-17 Thread Alistair Francis
-by: Atish Patra Reviewed-by: Daniel Henrique Barboza Signed-off-by: Kaiwen Xue Acked-by: Alistair Francis Message-ID: <20240711-smcntrpmf_v7-v8-5-b7c38ae7b...@rivosinc.com> Signed-off-by: Alistair Francis --- target/riscv/cpu_bits.h | 12 target/riscv/csr.c

[PULL 11/30] disas/riscv: Support zabha disassemble

2024-07-17 Thread Alistair Francis
From: LIU Zhiwei Signed-off-by: LIU Zhiwei Acked-by: Alistair Francis Message-ID: <20240709113652.1239-12-zhiwei_...@linux.alibaba.com> Signed-off-by: Alistair Francis --- disas/riscv.c | 60 +++ 1 file changed, 60 insertions(+) diff

[PULL 00/30] riscv-to-apply queue

2024-07-17 Thread Alistair Francis
The following changes since commit 58ee924b97d1c0898555647a31820c5a20d55a73: Merge tag 'for-upstream' of https://gitlab.com/bonzini/qemu into staging (2024-07-17 15:40:28 +1000) are available in the Git repository at: https://github.com/alistair23/qemu.git

Re: [PATCH v2] hw/riscv/virt.c: re-insert and deprecate 'riscv, delegate'

2024-07-15 Thread Alistair Francis
c: Conor Dooley > Cc: Anup Patel > Fixes: b1f1e9dcfa ("hw/riscv/virt.c: aplic DT: rename prop to 'riscv, > delegation'") > Signed-off-by: Daniel Henrique Barboza > Reviewed-by: Alistair Francis Thanks! Applied to riscv-to-apply.next Alistair > --- > > v2: &g

Re: [PATCH v8 00/13] Add RISC-V ISA extension smcntrpmf support

2024-07-14 Thread Alistair Francis
et/riscv/cpu.h| 20 ++- > target/riscv/cpu_bits.h | 41 + > target/riscv/cpu_cfg.h| 1 + > target/riscv/cpu_helper.c | 66 +++ > target/riscv/csr.c| 437 > +- > target/riscv/machine.c| 5 +- > target/

Re: [PATCH v8 13/13] target/riscv: Expose the Smcntrpmf config

2024-07-14 Thread Alistair Francis
On Fri, Jul 12, 2024 at 8:34 AM Atish Patra wrote: > > Create a new config for Smcntrpmf extension so that it can be enabled/ > disabled from the qemu commandline. > > Signed-off-by: Atish Patra Acked-by: Alistair Francis Alistair > --- > target/riscv/cpu.c | 1 +

Re: [PATCH v8 06/13] target/riscv: Only set INH fields if priv mode is available

2024-07-14 Thread Alistair Francis
On Fri, Jul 12, 2024 at 8:34 AM Atish Patra wrote: > > Currently, the INH fields are set in mhpmevent uncoditionally > without checking if a particular priv mode is supported or not. > > Suggested-by: Alistair Francis > Signed-off-by: Atish Patra Thanks! Acked-by: Alistair

Re: [PATCH v8 05/13] target/riscv: Add cycle & instret privilege mode filtering support

2024-07-14 Thread Alistair Francis
o actual > effects on the counting of cycle and instret counters. > > Signed-off-by: Atish Patra > Reviewed-by: Daniel Henrique Barboza > Signed-off-by: Kaiwen Xue Acked-by: Alistair Francis Alistair > --- > target/riscv/cpu_bits.h | 12

Re: [PATCH v8 03/13] target/riscv: Add cycle & instret privilege mode filtering properties

2024-07-14 Thread Alistair Francis
On Fri, Jul 12, 2024 at 8:33 AM Atish Patra wrote: > > From: Kaiwen Xue > > This adds the properties for ISA extension smcntrpmf. Patches > implementing it will follow. > > Signed-off-by: Kaiwen Xue > Reviewed-by: Daniel Henrique Barboza > Signed-off-by: Atish Pa

Re: [PATCH] hw/riscv/virt.c: re-insert and deprecate 'riscv, delegate'

2024-07-14 Thread Alistair Francis
ion'. 'riscv,delegate' is then marked for future > deprecation and its use is being discouraged. > > Cc: Conor Dooley > Cc: Anup Patel > Fixes: b1f1e9dcfa ("hw/riscv/virt.c: aplic DT: rename prop to 'riscv, > delegation'") > Signed-off-by: Daniel Henrique Barboza Thanks

Re: [PATCH] hw/riscv/virt.c: re-insert and deprecate 'riscv, delegate'

2024-07-14 Thread Alistair Francis
ion'. 'riscv,delegate' is then marked for future > deprecation and its use is being discouraged. > > Cc: Conor Dooley > Cc: Anup Patel > Fixes: b1f1e9dcfa ("hw/riscv/virt.c: aplic DT: rename prop to 'riscv, > delegation'") > Signed-off-by: Daniel Henrique Barboza Re

Re: [PATCH v4] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-07-11 Thread Alistair Francis
On Tue, Jun 4, 2024 at 7:15 PM Yu-Ming Chang via wrote: Something is strange with your `From` email address. This seems to be a common problem with the Andes emails, do you mind fixing this? Alistair > > Both CSRRS and CSRRC always read the addressed CSR and cause any read side >

Re: [RFC PATCH 16/16] hw/riscv: virt: Add WorldGuard support

2024-07-11 Thread Alistair Francis
entation here. The WID of M-mode for example is set by an external environment. How are users going to set that in QEMU? Are the Smwg, Smwgd, and Sswg extensions enabled? Or is it hard coded one world per hart? We should make it clear to users how this is setup as the spec leaves a lot o

Re: [RFC PATCH 06/16] target/riscv: Add hard-coded CPU state of WG extension

2024-07-11 Thread Alistair Francis
h -x and default to 'false'. > */ > DEFINE_PROP_BOOL("x-misa-w", RISCVCPU, cfg.misa_w, false), > +DEFINE_PROP_UINT32("mwid", RISCVCPU, cfg.mwid, UINT32_MAX), > +DEFINE_PROP_UINT32("mwidlist", RISCVCPU, cfg.mwidlist, UINT32_MAX), The

Re: [RFC PATCH 05/16] target/riscv: Add CPU options of WorldGuard CPU extension

2024-07-11 Thread Alistair Francis
want to maintain bistability. I understand this doesn't break the build, but it's a bit strange to allow users to enable something when at this point it doesn't yet work Alistair > + > DEFINE_PROP_END_OF_LIST(), > }; > > diff --git a/target/riscv/cpu_cfg.h b/target/riscv/c

Re: [RFC PATCH 04/16] hw/misc: riscv_worldguard: Add RISC-V WorldGuard global config

2024-07-11 Thread Alistair Francis
X_VERSAL_TRNG > bool > > +config RISCV_WORLDGUARD > +bool We should ensure this is enabled as well so that it is built by default Alistair > + > source macio/Kconfig > diff --git a/hw/misc/meson.build b/hw/misc/meson.build > index 86596a3888..a75668ff86 100644

Re: [RFC PATCH 03/16] exec: Add RISC-V WorldGuard WID to MemTxAttrs

2024-07-11 Thread Alistair Francis
; +/* > + * RISC-V WorldGuard: the 5-bit WID of memory access. > + */ > +uint8_t world_id; Everything else is using `unsigned int` so I think we should as well Alistair > } MemTxAttrs; > > /* Bus masters which don't specify any attributes will get this, > -- > 2.17.1 > >

Re: [PATCH v5 0/7] target/riscv: Expose RV32 cpu to RV64 QEMU

2024-07-11 Thread Alistair Francis
target/riscv: Add fw_dynamic_info32 for booting RV32 OpenSBI > target/riscv: Adjust PMP size for no-MMU RV64 QEMU running RV32 > target/riscv: Correct SXL return value for RV32 in RV64 QEMU > target/riscv: Detect sxl to set bit width for RV32 in RV64 > target/riscv: Correct mcau

Re: [PATCH v2 13/13] target/riscv: Simplify probing in vext_ldff

2024-07-09 Thread Alistair Francis
ith > its nonfault parameter set to true. > > Signed-off-by: Richard Henderson Acked-by: Alistair Francis Alistair > --- > target/riscv/vector_helper.c | 34 ++ > 1 file changed, 18 insertions(+), 16 deletions(-) > > diff --git a/t

Re: [PATCH v4 00/11] target/riscv: Support zimop/zcmop/zama16b/zabha

2024-07-09 Thread Alistair Francis
nstead of assemble code. > > This patch set has been queued to alistair/riscv-to-apply.next, but it is > still not > merged by the master branch. I think we had better fix it before merging into > the > master. > > v3->v4: > 1. Fix zimop opcode and disassemb

Re: [PATCH v4 5/7] target/riscv: Correct mcause/scause bit width for RV32 in RV64 QEMU

2024-07-09 Thread Alistair Francis
On Mon, Jul 8, 2024 at 11:21 PM LIU Zhiwei wrote: > > From: TANG Tiancheng > > Ensure mcause high bit is correctly set by using 32-bit width for RV32 > mode and 64-bit width for RV64 mode. > > Signed-off-by: TANG Tiancheng > Reviewed-by: Liu Zhiwei Reviewed-by: Ali

Re: [PATCH v4 7/7] tests/avocado: Add an avocado test for riscv64

2024-07-09 Thread Alistair Francis
t; > Signed-off-by: TANG Tiancheng > Reviewed-by: Liu Zhiwei > Acked-by: Alistair Francis > Reviewed-by: Alistair Francis Something is wrong here, it should only be an Ack Alistair

Re: [PATCH 2/2] target/riscv: Add textra matching condition for the triggers

2024-07-09 Thread Alistair Francis
them here. > > Signed-off-by: Alvin Chang Reviewed-by: Alistair Francis Alistair > --- > target/riscv/debug.c | 63 +++- > target/riscv/debug.h | 3 +++ > 2 files changed, 65 insertions(+), 1 deletion(-) > > diff --git a/target/r

Re: [PATCH 1/2] target/riscv: Preliminary textra trigger CSR writting support

2024-07-09 Thread Alistair Francis
_action(CPURISCVState *env, target_ulong trigger_index) > { > trigger_action_t action = get_trigger_action(env, trigger_index); > @@ -441,8 +504,10 @@ static void type2_reg_write(CPURISCVState *env, > target_ulong index, > } > break; > case TDAT

Re: [PATCH v2 6/9] tests/qtest/bios-tables-test.c: Remove the fall back path

2024-07-09 Thread Alistair Francis
th > as well. > > Suggested-by: Igor Mammedov > Signed-off-by: Sunil V L Acked-by: Alistair Francis Alistair > --- > tests/qtest/bios-tables-test.c | 14 -- > 1 file changed, 14 deletions(-) > > diff --git a/tests/qtest/bios-tables-test.c b/tests/qtest/bios-table

Re: [PATCH] target/riscv/kvm: update KVM regs to Linux 6.10-rc5

2024-07-09 Thread Alistair Francis
On Tue, Jul 9, 2024 at 6:55 PM Daniel Henrique Barboza wrote: > > Two new regs added: ztso and zacas. > > Signed-off-by: Daniel Henrique Barboza Thanks! Applied to riscv-to-apply.next Alistair > --- > target/riscv/kvm/kvm-cpu.c | 2 ++ > 1 file changed, 2 inserti

Re: [PATCH] target/riscv/kvm: update KVM regs to Linux 6.10-rc5

2024-07-09 Thread Alistair Francis
On Tue, Jul 9, 2024 at 6:55 PM Daniel Henrique Barboza wrote: > > Two new regs added: ztso and zacas. > > Signed-off-by: Daniel Henrique Barboza Reviewed-by: Alistair Francis Alistair > --- > target/riscv/kvm/kvm-cpu.c | 2 ++ > 1 file changed, 2 insertions(+) > >

Re: [PATCH v7 2/2] hw/riscv/virt: Add IOPMP support

2024-07-07 Thread Alistair Francis
On Wed, Jun 26, 2024 at 3:53 PM Ethan Chen wrote: > > On Wed, Jun 26, 2024 at 11:22:46AM +1000, Alistair Francis wrote: > > > > On Mon, Jun 24, 2024 at 11:47 AM Ethan Chen wrote: > > > > > > Hi Alistair, > > > > > > IOPMP can

Re: [PATCH] target/riscv: Fix the check with vector register multiples of LMUL

2024-07-07 Thread Alistair Francis
ting the commit message to describe what exactly this fixes (as in what issue you had) and why this fixes it Alistair > > Signed-off-by: Zhiwei Jiang > --- > target/riscv/insn_trans/trans_rvv.c.inc | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/target/r

Re: [PATCH v4] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-07-07 Thread Alistair Francis
Signed-off-by: Yu-Ming Chang > Signed-off-by: Alvin Chang Thanks! Applied to riscv-to-apply.next Alistair > --- > Hi Alistair, > This fixed the issue of riscv_csrrw_debug(). > > Best regards, > Yuming > > target/riscv/cpu.h | 4 +++ > target/risc

Re: [PATCH v4] target/riscv: raise an exception when CSRRS/CSRRC writes a read-only CSR

2024-07-07 Thread Alistair Francis
Signed-off-by: Yu-Ming Chang > Signed-off-by: Alvin Chang Reviewed-by: Alistair Francis Alistair > --- > Hi Alistair, > This fixed the issue of riscv_csrrw_debug(). > > Best regards, > Yuming > > target/riscv/cpu.h | 4 +++ > target/riscv/csr.

Re: [PATCH qemu] target/riscv: Add Zilsd and Zcmlsd extension support

2024-07-07 Thread Alistair Francis
f the GNU General Public License along > with > + * this program. If not, see <http://www.gnu.org/licenses/>. > + */ > + > +#define REQUIRE_ZCMLSD(ctx) do {\ > +if (!ctx->cfg_ptr->ext_zcmlsd) \ > +return false; \ > +} while (0) > +

Re: [PATCH v4 16/16] tests/qtest/bios-tables-test: Add expected ACPI data files for RISC-V

2024-07-07 Thread Alistair Francis
mented in bios-tables-test.c, > > > > > > generate the expected ACPI AML data files for RISC-V using the > > > > > > rebuild-expected-aml.sh script and update the > > > > > > bios-tables-test-allowed-diff.h. > > > > > > > > >

Re: [PATCH v3 7/7] tests/avocado: Add an avocado test for riscv64

2024-07-07 Thread Alistair Francis
t; > Signed-off-by: TANG Tiancheng > Reviewed-by: Liu Zhiwei Acked-by: Alistair Francis Alistair > --- > tests/avocado/boot_linux_console.py | 37 + > 1 file changed, 37 insertions(+) > > diff --git a/tests/avocado/boot_linux_console.py &g

Re: [PATCH v3 6/7] target/riscv: Enable RV32 CPU support in RV64 QEMU

2024-07-07 Thread Alistair Francis
On Thu, Jul 4, 2024 at 12:55 AM LIU Zhiwei wrote: > > From: TANG Tiancheng > > Add gdb XML files and adjust CPU initialization to allow running RV32 CPUs > in RV64 QEMU. > > Signed-off-by: TANG Tiancheng > Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis Al

Re: [PATCH v3 4/7] target/riscv: Detect sxl to set bit width for RV32 in RV64

2024-07-07 Thread Alistair Francis
/cpu_helper.c > @@ -887,12 +887,14 @@ static int get_physical_address(CPURISCVState *env, > hwaddr *physical, > > CPUState *cs = env_cpu(env); > int va_bits = PGSHIFT + levels * ptidxbits + widened; > +int sxlen = 16UL << riscv_cpu_sxl(env); A leftover U

Re: [PATCH v2] disas/riscv: Add decode for Zawrs extension

2024-07-07 Thread Alistair Francis
On Sat, Jul 6, 2024 at 2:54 AM Rob Bradford wrote: > > From: Balaji Ravikumar > > Add disassembly support for these instructions from Zawrs: > > * wrs.sto > * wrs.nto > > Signed-off-by: Balaji Ravikumar > Signed-off-by: Rob Bradford Thanks! Applied to

Re: [PATCH v2] disas/riscv: Add decode for Zawrs extension

2024-07-07 Thread Alistair Francis
On Sat, Jul 6, 2024 at 2:54 AM Rob Bradford wrote: > > From: Balaji Ravikumar > > Add disassembly support for these instructions from Zawrs: > > * wrs.sto > * wrs.nto > > Signed-off-by: Balaji Ravikumar > Signed-off-by: Rob Bradford Acked-by: Alistair Fran

Re: [PATCH v4 00/14] riscv: QEMU RISC-V IOMMU Support

2024-07-07 Thread Alistair Francis
r to review since > we'll have a more complete picture. Patch 3 will end up gaining +381 lines > though. Squashing is probably the way to go Alistair

Re: [PATCH] hw/intc: sifive_plic: Fix heap-buffer-overflow in SiFive PLIC read operation

2024-07-07 Thread Alistair Francis
5; > > so presumably the intention was that we put enough words > in the bitfield for the number of sources we have, so that > the array access wouldn't overrun. Maybe we got the > calculation wrong? Yeah, the calculation is wrong here. We have s->bitfield_words = (s->num_sour

Re: [PATCH v3 3/7] target/riscv: Correct SXL return value for RV32 in RV64 QEMU

2024-07-07 Thread Alistair Francis
4") > Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis Alistair > --- > target/riscv/cpu.h | 5 - > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h > index 87742047ce..49de81be7e 100644 > --- a/target/

Re: [PATCH] target/riscv: Validate the mode in write_vstvec

2024-07-07 Thread Alistair Francis
On Mon, Jul 1, 2024 at 3:42 PM Jiayi Li wrote: > > Base on the riscv-privileged spec, vstvec substitutes for the usual stvec. > Therefore, the encoding of the MODE should also be restricted to 0 and 1. > > Signed-off-by: Jiayi Li Thanks! Applied to riscv-to-apply

Re: [PATCH] target/riscv: Validate the mode in write_vstvec

2024-07-07 Thread Alistair Francis
On Mon, Jul 1, 2024 at 3:42 PM Jiayi Li wrote: > > Base on the riscv-privileged spec, vstvec substitutes for the usual stvec. > Therefore, the encoding of the MODE should also be restricted to 0 and 1. > > Signed-off-by: Jiayi Li Reviewed-by: Alistair Francis Alistair > -

[PATCH v8 0/3] Initial support for SPDM Responders

2024-07-03 Thread Alistair Francis
implements socket support and exposes SPDM for a NVMe device. 1: https://github.com/DMTF/libspdm v8: - Fixup i386 failures (thanks to Wilfred) - Passes CI on GitLab: https://gitlab.com/alistair23/qemu/-/tree/mainline/alistair/spdm-socket.next?ref_type=heads v7: - Fixup checkpatch failures - Fixup test

[PATCH v8 3/3] hw/nvme: Add SPDM over DOE support

2024-07-03 Thread Alistair Francis
From: Wilfred Mallawa Setup Data Object Exchange (DOE) as an extended capability for the NVME controller and connect SPDM to it (CMA) to it. Signed-off-by: Wilfred Mallawa Signed-off-by: Alistair Francis Reviewed-by: Jonathan Cameron Acked-by: Klaus Jensen --- docs/specs/index.rst

[PATCH v8 2/3] backends: Initial support for SPDM socket support

2024-07-03 Thread Alistair Francis
-by: Jonathan Cameron Signed-off-by: Jonathan Cameron [ Changes by WM - Bug fixes from testing ] Signed-off-by: Wilfred Mallawa [ Changes by AF: - Convert to be more QEMU-ified - Move to backends as it isn't PCIe specific ] Signed-off-by: Alistair Francis --- MAINTAINERS | 6

[PATCH v8 1/3] hw/pci: Add all Data Object Types defined in PCIe r6.0

2024-07-03 Thread Alistair Francis
Add all of the defined protocols/features from the PCIe-SIG r6.0 "Table 6-32 PCI-SIG defined Data Object Types (Vendor ID = 0001h)" table. Signed-off-by: Alistair Francis Reviewed-by: Jonathan Cameron Reviewed-by: Wilfred Mallawa --- include/hw/pci/pcie_doe.h | 2 ++ 1 file

Re: [PATCH 0/6] target/riscv: Expose RV32 cpu to RV64 QEMU

2024-07-02 Thread Alistair Francis
> > processor : 0 > > hart: 0 > > isa : > > rv32imafdch_zicbom_zicboz_zicntr_zicsr_zifencei_zihintntl_zihintpause_zihpm_zfa_zba_zbb_zbc_zbs_sstc > > mmu : sv32 > > Please provide an Avocado test (i.e. checking /proc/cpuinfo > contains "isa : rv32"). See for reference > tests/avocado/boot_linux_console.py. Awesome! Thanks for this, this is very exciting. I agree we should add an Avacado test, that way this will be regularly tested as it's something that seems prone to breakage. Alistair > > Thanks! >

Re: [PATCH 4/6] target/riscv: Detect sxl to set bit width for RV32 in RV64

2024-07-02 Thread Alistair Francis
late(cs->as, pte_addr, , , > false, MEMTXATTRS_UNSPECIFIED); > if (memory_region_is_ram(mr)) { > @@ -1126,6 +1128,11 @@ restart: > *pte_pa = pte = updated_pte; > #else > target_ulong old_pte = qatomic_cmpxchg(pte

Re: [PATCH 2/6] target/riscv: Adjust PMP size for no-MMU RV64 QEMU running RV32

2024-07-02 Thread Alistair Francis
On Mon, Jul 1, 2024 at 1:40 PM LIU Zhiwei wrote: > > From: TANG Tiancheng > > Ensure pmp_size is correctly determined using mxl for RV32 > in RV64 QEMU. > > Signed-off-by: TANG Tiancheng > Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis Alistair > --

Re: [PATCH 1/6] target/riscv: Add fw_dynamic_info32 for booting RV32 OpenSBI

2024-07-02 Thread Alistair Francis
fw_dynmaic_info32 struct for this purpose. > > Signed-off-by: TANG Tiancheng > Reviewed-by: Liu Zhiwei Reviewed-by: Alistair Francis Alistair > --- > hw/riscv/boot.c | 35 ++--- > hw/riscv/sifive_u.c | 3 ++- > include

Re: [PATCH] disas/riscv: Add decode for Zawrs extension

2024-07-02 Thread Alistair Francis
Do you mind rebasing on https://github.com/alistair23/qemu/tree/riscv-to-apply.next and re-sending Alistair > --- > disas/riscv.c | 6 ++ > 1 file changed, 6 insertions(+) > > diff --git a/disas/riscv.c b/disas/riscv.c > index 90d6b26de9..e79788ea0a 100644 > --- a/disas/riscv.c

Re: [PATCH] disas/riscv: Add decode for Zawrs extension

2024-07-02 Thread Alistair Francis
On Wed, Jun 26, 2024 at 7:43 PM Rob Bradford wrote: > > From: Balaji Ravikumar > > Add disassembly support for these instructions from Zawrs: > > * wrs.sto > * wrs.nto > > Signed-off-by: Balaji Ravikumar > Signed-off-by: Rob Bradford Acked-by: Alistair Fran

Re: [PATCH v3 00/11] target/riscv: Support zimop/zcmop/zama16b/zabha

2024-07-02 Thread Alistair Francis
e gen_cmpxchg before adding amocas.[b|h] > target/riscv: Add amocas.[b|h] for Zabha > target/riscv: Expose zabha extension as a cpu property > disas/riscv: Support zabha disassemble Thanks! Applied to riscv-to-apply.next Alistair > > disas/riscv.c

  1   2   3   4   5   6   7   8   9   10   >