Hi, all.
I'v left my job at Iscas. The old iscas mail acount will be
disabled soon. So I'll change to use my personal gmail acount
(liwei1...@gmail.com) for future reviewer tasks.
Regards,
Weiwei Li
Weiwei Li (1):
MAINTAINERS: update mail address for Weiwei Li
MAINTAINERS | 2
My Iscas mail account will be disabled soon, change to my personal
gmail account.
Signed-off-by: Weiwei Li
---
MAINTAINERS | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index cd8d6b140f..aa5c5d4bff 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
The Svadu specification updated the name of the *envcfg bit from
HADE to ADUE.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
v2:
* rename hade variable name to adue suggested by Daniel
target/riscv/cpu.c| 4 ++--
target/riscv/cpu_bits.h | 8
target/riscv
The Svadu specification updated the name of the *envcfg bit from
HADE to ADUE.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.c| 4 ++--
target/riscv/cpu_bits.h | 8
target/riscv/cpu_helper.c | 4 ++--
target/riscv/csr.c| 12
it's strange to force users to set 'vext_spec' to get rid of this
message.
Change riscv_cpu_validate_v() to not throw this log message if
env->vext_ver is already set.
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c |
On 2023/7/28 08:39, LIU Zhiwei wrote:
Commit a47842d ("riscv: Add support for the Zfa extension") implemented the zfa
extension.
However, it has some typos for fleq.d and fltq.d. Both of them misused the
fltq.s
helper function.
Signed-off-by: LIU Zhiwei
---
Reviewed-by:
On 2023/7/20 21:24, Daniel Henrique Barboza wrote:
The cpu->cfg.epmp extension is still experimental, but it already has a
'smepmp' riscv,isa string. Add it.
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c | 1 +
1 fi
ue Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 9339c0241d..d64ac07558 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv/cpu.c
@@ -88,6 +88,7 @@ static const struct isa_ext_data isa
On 2023/7/21 01:19, Daniel Henrique Barboza wrote:
Use a macro in riscv_cpu_add_kvm_properties() to eliminate some of its
code repetition, similar to what we're already doing with
ADD_CPU_QDEV_PROPERTIES_ARRAY().
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiw
to
encapsulate more repetitions in macros later on.
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c | 12
1 file changed, 4 insertions(+), 8 deletions(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 7f0852a14e..4d
dd. The rest of
riscv_cpu_add_user_properties() body will then be relieved from having
to deal with KVM constraints.
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c | 65 ++
1 file changed, 42 insertions(+), 23 deletions(-
the point that these
are more a CPU option than an extension.
No functional changes made.
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c | 33 +++--
1 file changed, 23 insertions(+), 10 deletions(-)
diff --gi
_0},
+[CSR_MINSTRETCFGH] = { "minstretcfgh", smcntrpmf, read_minstretcfgh,
+ write_minstretcfgh,
+ .min_priv_ver = PRIV_VERSION_1_12_0},
This two CSRs are RV32-only, they cannot directly share the same
predicate as MCYCLECFG
fpmf", RISCVCPU, cfg.ext_sscofpmf, false),
+DEFINE_PROP_BOOL("smcntrpmf", RISCVCPU, cfg.ext_smcntrpmf, false),
Normally, property should be exposed to user at last after the function
is implemented.
Regards,
Weiwei Li
DEFINE_PROP_BOOL("Zifence
: configure instructions")
Signed-off-by: Rob Bradford
---
V2: Switch check to use VLEN and active SEW vs ELEN and minimum SEW
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/vector_helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/riscv/v
On 2023/7/17 23:13, Rob Bradford wrote:
On Thu, 2023-07-06 at 21:22 +0800, Weiwei Li wrote:
On 2023/7/6 18:44, Rob Bradford wrote:
The previous check was failing with:
ELEN = 64 SEW = 16 and LMUL = 1/8 (encoded as 5) which is a valid
combination.
Fix the check to correctly match the
("target/riscv: add cfg properties for Zc* extension")
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 9339c0241d..6b93
disabled.
This is the resulting 'riscv,isa' DT for this new CPU:
rv64imafdcvh_zicbom_zicboz_zicsr_zifencei_zihintpause_zawrs_zfa_
zfh_zfhmin_zca_zcb_zcd_zba_zbb_zbc_zbkb_zbkc_zbkx_zbs_zk_zkn_zknd_
zkne_zknh_zkr_zks_zksed_zksh_zkt_zve32f_zve64f_zve64d_
smstateen_sscofpmf_sstc_svadu_svinval_svnapot_svpbmt
Signed-off-by: Daniel Henrique Barboza
---
R
On 2023/7/15 01:43, Daniel Henrique Barboza wrote:
The code inside riscv_cpu_add_user_properties() became quite repetitive
after recent changes. Add a macro to hide the repetition away.
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/cpu.c
pec in another way:
we must support lmul=1/8 when ELEN=64, but it's only available when sew = 8.
Regards,
Weiwei Li
`
Regards,
Weiwei Li
Fixes: d9b7609a1fb2 ("target/riscv: rvv-1.0: configure instructions")
Signed-off-by: Rob Bradford
---
target/riscv/vector_helper.c |
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
disas/riscv.c | 44
1 file changed, 44 insertions(+)
diff --git a/disas/riscv.c b/disas/riscv.c
index 94e568a7e9..9f0195be30 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
@@ -819,6 +819,16
extensions in patch 1 and patch 4
* Update encodings for BF16 instructions in patch 2,3,4
* Add disas support for BF16 instructions in patch 6
Weiwei Li (1):
target/riscv: Add disas support for BF16 extensions
disas/riscv.c | 44
1 file changed, 44
a_field)) {
+if ((sa_in & ea_in) && (PMP_AMATCH_OFF != a_field)) {
I think it's better to use "sa_in && ea_in &&(...)" here.
Regards,
Weiwei Li
/*
* If the PMP entry is not off and the address is in range,
* do the priv check
On 2023/6/28 18:36, Ruibo Lu wrote:
the check of top PMP is redundant and will not influence the return
value, so consider remove it
Signed-off-by: Ruibo Lu
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/pmp.c | 5 -
1 file changed, 5 deletions(-)
diff --git a/target/riscv
On 2023/6/15 17:21, Daniel Henrique Barboza wrote:
Cc: qemu-triv...@nongnu.org
Signed-off-by: Daniel Henrique Barboza
---
Reviewed-by: Weiwei Li
Weiwei Li
hw/riscv/virt.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/hw/riscv/virt.c b/hw/riscv/virt.c
index
On 2023/6/15 20:58, Rob Bradford wrote:
On Thu, 2023-06-15 at 14:32 +0800, Weiwei Li wrote:
Add ext_zfbfmin/zvfbfmin/zvfbfwma properties.
Add require check for BF16 extensions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
target/riscv
mm = operand_imm6(inst);
+break;
+case rv_codec_r_imm2:
+dec->rd = operand_rd(inst);
+dec->rs1 = operand_rs1(inst);
+dec->rs2 = operand_rs2(inst);
+dec->imm = operand_imm2(inst);
+break;
+case rv_codec_r2_immhl:
+dec->rd = operand_
patch includes a small change:
The parameter for the extension test functions has been changed
from 'DisasContext*' to 'const RISCVCPUConfig*' to keep
the code in cpu_cfg.h self-contained.
Signed-off-by: Christoph Müllner
---
Reviewed-by: Weiwei Li
Weiwei Li
target/ri
Add trans_* and helper function for Zvfbfmin instructions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
---
target/riscv/helper.h | 3 +
target/riscv/insn32.decode | 4 ++
target/riscv/insn_trans/trans_rvbf16.c.inc
Add trans_* and helper function for Zfbfmin instructions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
---
target/riscv/fpu_helper.c | 12 +
target/riscv/helper.h | 4 ++
target/riscv/insn32.decode
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
disas/riscv.c | 44
1 file changed, 44 insertions(+)
diff --git a/disas/riscv.c b/disas/riscv.c
index 5005364aba..44ea69315c 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
@@ -964,6 +964,16
Add trans_* and helper function for Zvfbfwma instructions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
---
target/riscv/helper.h | 3 ++
target/riscv/insn32.decode | 4 ++
target/riscv/insn_trans/trans_rvbf16
in patch 2,3,4
* Add disas support for BF16 instructions in patch 6
Weiwei Li (6):
target/riscv: Add properties for BF16 extensions
target/riscv: Add support for Zfbfmin extension
target/riscv: Add support for Zvfbfmin extension
target/riscv: Add support for Zvfbfwma extension
target
Add ext_zfbfmin/zvfbfmin/zvfbfwma properties.
Add require check for BF16 extensions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
target/riscv/cpu.c | 20
target/riscv/cpu_cfg.h | 3 +++
2 files changed, 23 insertions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
target/riscv/cpu.c | 7 +++
1 file changed, 7 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index dc6b2f72f6..feb0ee5e6f 100644
--- a/target/riscv/cpu.c
+++ b/target/riscv
Currently, we use the current env->xl as the xlen for address. However, the
xlen for data address should be changed to the xlen related to MPP when MPRV=1.
The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-addr-xl-upstream
Weiwei Li (2):
target/riscv: Add additio
As specified in privilege spec:"When MPRV=1, load and store memory
addresses are treated as though the current XLEN were set to MPP’s
XLEN". So the xlen for address may be different from current xlen.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.h
Pointer mask is also affected by MPRV which means cur_pmbase/pmmask
should also take MPRV into consideration. As pointer mask for instruction
is not supported currently, so we can directly update cur_pmbase/pmmask
based on address related mode and xlen affected by MPRV now.
Signed-off-by: Weiwei
On 2023/6/12 13:40, LIU Zhiwei wrote:
On 2023/6/12 12:35, Weiwei Li wrote:
On 2023/6/12 11:18, LIU Zhiwei wrote:
On 2023/6/12 11:16, Weiwei Li wrote:
On 2023/6/12 11:08, LIU Zhiwei wrote:
On 2023/5/29 20:17, Weiwei Li wrote:
MPV and GVA bits are added by hypervisor extension to
On 2023/6/12 11:18, LIU Zhiwei wrote:
On 2023/6/12 11:16, Weiwei Li wrote:
On 2023/6/12 11:08, LIU Zhiwei wrote:
On 2023/5/29 20:17, Weiwei Li wrote:
MPV and GVA bits are added by hypervisor extension to mstatus
and mstatush (if MXLEN=32).
Have you found the CSR field specifications
On 2023/6/12 11:08, LIU Zhiwei wrote:
On 2023/5/29 20:17, Weiwei Li wrote:
MPV and GVA bits are added by hypervisor extension to mstatus
and mstatush (if MXLEN=32).
Have you found the CSR field specifications for them, especially for GVA.
Yeah. in the section 9.4.1 of the privilege spec
On 2023/6/12 10:45, LIU Zhiwei wrote:
On 2023/5/29 20:17, Weiwei Li wrote:
Upon MRET or explicit memory access with MPRV=1, MPV should be ignored
when MPP=PRV_M.
Does MPP==PRV_M always indicate the MPV==0?
No, I think . The spec doesn't restrict this. When MPP=PRV_M, MPV wll be
.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index 09ea227ceb..acbcb7ed76 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv
("target/riscv: rvv: Add tail agnostic for vector load / store
instructions")
Signed-off-by: Xiao Wang
---
Reviewed-by: Weiwei Li
Weiwei Li
v2:
* Rebased on top of Alistair's riscv-to-apply.next branch.
---
target/riscv/vector_helper.c | 22 ++
1 fil
return in place when address matches
o Call pmp_hart_has_privs_default at the end of the loop
Fixes: 90b1fafce06 ("target/riscv: Smepmp: Skip applying default rules when address
matches")
Signed-off-by: Himanshu Chauhan
---
Reviewed-by: Weiwei Li
Weiwei Li
target/riscv/
break;
+return (privs & *allowed_privs) == privs ? true : false;
This conditional assignment is unnecessary.
+ return (privs & *allowed_privs) ==
privs;
Otherwise, Reviewed-by: Weiwei Li
Weiwei Li
}
}
to _address_matched;
goto seems unnecessary. We can directly return (privs & *allowed_privs)
== privs here.
And then we can directly return pmp_hart_has_privs_default(env, privs,
allowed_privs, mode) after this loop.
Regards,
Weiwei Li
}
}
@@ -445,6 +445,7 @@
On 2023/6/3 05:01, Richard Henderson wrote:
On 6/1/23 18:31, Weiwei Li wrote:
Even though MPRV normally can be set to 1 in M mode, it seems
possible to set it to 1 in other mode by gdbstub.
That would seem to be a gdbstub bug, since it is cleared on exit from
M-mode, and cannot be set
SXL is initialized as env->misa_mxl which is also the mxl value.
So we can just remain it unchanged to keep it read-only.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
Reviewed-by: Alistair Francis
---
target/riscv/csr.c | 4
1 file chan
This patchset tries to fix some problems in the fields of mstatus, such as make
MPV only work when MPP != PRM.
The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-mpv-upstream-v2
v2:
* Drop patch 3 (remove check on mode M for MPRV)
* rebase on apply-to-riscv.next
Weiwei
Upon MRET or explicit memory access with MPRV=1, MPV should be ignored
when MPP=PRV_M.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
Reviewed-by: Alistair Francis
---
target/riscv/cpu_helper.c | 3 ++-
target/riscv/op_helper.c | 3 ++-
2 files
MPV and GVA bits are added by hypervisor extension to mstatus
and mstatush (if MXLEN=32).
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
Reviewed-by: Alistair Francis
---
target/riscv/csr.c | 10 --
1 file changed, 4 insertions(+), 6
clude "insn_trans/trans_rvv.c.inc"
#include "insn_trans/trans_rvb.c.inc"
#include "insn_trans/trans_rvzicond.c.inc"
+#include "insn_trans/trans_rvzacas.c.inc"
#include "insn_trans/trans_rvzawrs.c.inc"
#include "insn_trans/trans_rvzicbo.c.inc"
#include "insn_trans/trans_rvzfh.c.inc"
It seems lack check on "Zacas requires A"
Regards,
Weiwei Li
On 2023/6/2 20:16, Rob Bradford wrote:
This commit adds support for the the amocas.{w,d,q} instructions behind
a new property to enable that instruction.
Signed-off-by: Rob Bradford
---
I also implemented an initial version for this extension without any
tests a few days ago.
You can fin
On 2023/6/2 07:03, Alistair Francis wrote:
On Thu, Jun 1, 2023 at 4:43 PM Weiwei Li wrote:
On 2023/6/1 13:27, Alistair Francis wrote:
On Mon, May 29, 2023 at 10:19 PM Weiwei Li wrote:
Normally, MPRV can be set to 1 only in M mode (It will be cleared
when returning to lower-privilege mode
On 2023/6/1 13:27, Alistair Francis wrote:
On Mon, May 29, 2023 at 10:19 PM Weiwei Li wrote:
Normally, MPRV can be set to 1 only in M mode (It will be cleared
when returning to lower-privilege mode by MRET/SRET).
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv
On 2023/5/31 04:23, Daniel Henrique Barboza wrote:
On 5/29/23 09:17, Weiwei Li wrote:
Upon MRET or explicit memory access with MPRV=1, MPV should be ignored
when MPP=PRV_M.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 3 ++-
target/riscv
Normally, MPRV can be set to 1 only in M mode (It will be cleared
when returning to lower-privilege mode by MRET/SRET).
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv
SXL is initialized as env->misa_mxl which is also the mxl value.
So we can just remain it unchanged to keep it read-only.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/csr.c | 4
1 file changed, 4 deletions(-)
diff --git a/target/riscv/csr.c b/target/riscv/cs
Upon MRET or explicit memory access with MPRV=1, MPV should be ignored
when MPP=PRV_M.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 3 ++-
target/riscv/op_helper.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/target/riscv
This patchset tries to fix some problems in the fields of mstatus, such as make
MPV only work when MPP != PRM.
The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-mpv-upstream
Weiwei Li (4):
target/riscv: Make MPV only work when MPP != PRV_M
target/riscv: Remove check
MPV and GVA bits are added by hypervisor extension to mstatus
and mstatush (if MXLEN=32).
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/csr.c | 10 --
1 file changed, 4 insertions(+), 6 deletions(-)
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index
Reduce reliance on absolute values(by passing pc difference) to
prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn_trans/trans_privileged.c.inc | 2 +-
target/riscv
or Zc* instructions
Weiwei Li (7):
target/riscv: Fix target address to update badaddr
target/riscv: Introduce cur_insn_len into DisasContext
target/riscv: Change gen_goto_tb to work on displacements
target/riscv: Change gen_set_pc_imm to gen_update_pc
target/riscv: Use true diff for gen_pc_plus
Use cur_insn_len to store the length of the current instruction to
prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/translate.c | 4 +++-
1 file changed, 3 insertions(+), 1
Add a base pc_save for PC-relative translation(CF_PCREL).
Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb.
Use gen_pc_plus_diff to get the pc-relative address.
Enable CF_PCREL in System mode.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard
Reduce reliance on absolute values by using true pc difference for
gen_pc_plus_diff() to prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn_trans/trans_rvi.c.inc | 6
Reduce reliance on absolute value to prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn_trans/trans_rvi.c.inc | 4 ++--
target/riscv/translate.c| 8
current pc if exception is triggered.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn_trans/trans_rvi.c.inc | 23 ---
target/riscv/insn_trans/trans_rvzce.c.inc | 4 ++--
target/riscv
pc_succ_insn is no longer useful after the introduce of cur_insn_len
and all pc related value use diff value instead of absolute value.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/translate.c | 7
On 2023/5/24 13:35, Tommy Wu wrote:
Hi WeiWei Li,
When the CPU is realizing, it will call `riscv_gen_dynamic_csr_xml`
for the first time with the correct `base_reg` value.
code flow :
riscv_cpu_realize
→ riscv_cpu_register_gdb_regs_for_features
→ riscv_gen_dynamic_csr_xml
The
On 2023/5/24 09:51, Tommy Wu wrote:
Hi Weiwei Li,
Yes, you're right, `riscv_refresh_dynamic_csr_xml()` can only be
called when
cpu->dyn_csr_xml isn't a NULL pointer here.
The cpu->dyn_csr_xml will be set when the cpu is realized.
Yeah, It will be set only when Zicsr is
On 2023/5/24 09:59, Tommy Wu wrote:
Hi Weiwei Li,
`dyn_csr_base_reg` will be used in `riscv_refresh_dynamic_csr_xml`
We can initialize this variable when the cpu is realized.
I didn't find this initialization in following code.
And used this variable in `riscv_refresh_dynamic_cs
write_mstatus() can only change current xl when in debug mode.
And we need update cur_pmmask/base in this case.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: LIU Zhiwei
---
target/riscv/csr.c | 9 -
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a
actual_address = (requested_address & ~mpmmask) | mpmbase.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
Reviewed-by: LIU Zhiwei
---
target/riscv/vector_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/r
(patch 3~6) out of this patchset
Weiwei Li (2):
target/riscv: Fix pointer mask transformation for vector address
target/riscv: Update cur_pmmask/base when xl changes
target/riscv/csr.c | 9 -
target/riscv/vector_helper.c | 2 +-
2 files changed, 9 insertions(+), 2 deletions
cpu);
+
There is an assert in riscv_refresh_dynamic_csr_xml():
+if (!cpu->dyn_csr_xml) {
+g_assert_not_reached();
+}
So I think riscv_refresh_dynamic_csr_xml() can only be called when
cpu->dyn_csr_xml is true here.
Regards,
Weiwei Li
riscv_cpu_set_aia_ireg_rmw_fn(en
riscv_refresh_dynamic_csr_xml().
Regards,
Weiwei Li
char *dyn_csr_xml;
char *dyn_vreg_xml;
@@ -781,6 +782,7 @@ void riscv_get_csr_ops(int csrno, riscv_csr_operations *ops);
void riscv_set_csr_ops(int csrno, riscv_csr_operations *ops);
void riscv_cpu_register_gdb_regs_for_features
And support of PC-relative translation is the precondition to support
pointer mask for instruction.
The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-pcrel-upstream-v2
v2:
* rebase on upstream and add pc-relative translation for Zc* instructions
Weiwei Li (7):
target/
Use cur_insn_len to store the length of the current instruction to
prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/translate.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/target/riscv/translate.c b/target
Reduce reliance on absolute value to prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/insn_trans/trans_rvi.c.inc | 4 ++--
target/riscv/translate.c| 8 +---
2 files changed, 7 insertions(+), 5 deletions(-)
diff
Reduce reliance on absolute values(by passing pc difference) to
prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/insn_trans/trans_privileged.c.inc | 2 +-
target/riscv/insn_trans/trans_rvi.c.inc| 6 +++---
target/riscv
Add a base pc_save for PC-relative translation(CF_PCREL).
Diable the directly sync pc from tb by riscv_cpu_synchronize_from_tb.
Use gen_pc_plus_diff to get the pc-relative address.
Enable CF_PCREL in System mode.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.c
pc_succ_insn is no longer useful after the introduce of cur_insn_len
and all pc related value use diff value instead of absolute value.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/translate.c | 7 +--
1 file changed, 1 insertion(+), 6 deletions(-)
diff --git a
Reduce reliance on absolute values by using true pc difference for
gen_pc_plus_diff() to prepare for PC-relative translation.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/insn_trans/trans_rvi.c.inc | 6 ++
target/riscv/insn_trans/trans_rvzce.c.inc | 2
current pc if exception is triggered.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn_trans/trans_rvi.c.inc | 23 ---
target/riscv/insn_trans/trans_rvzce.c.inc | 4 ++--
target/riscv
Currently decomp_rv32 and decomp_rv64 value in opcode_data for vector
instructions are the same op index as their own. And they have no
functional decomp_data. So they have no functional difference from just
leaving them as zero.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by
Split RISCVCPUConfig declarations to prepare for passing it to disas.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.h | 114 +-
target/riscv/cpu_cfg.h | 136 +
2 files changed, 137
Remove redundant parenthese and fix multi-line comments.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
disas/riscv.c | 219 +-
1 file changed, 110 insertions(+), 109 deletions(-)
diff --git a
Barboza)
Weiwei Li (8):
disas: Change type of disassemble_info.target_info to pointer
target/riscv: Split RISCVCPUConfig declarations from cpu.h into
cpu_cfg.h
target/riscv: Pass RISCVCPUConfig as target_info to disassemble_info
disas/riscv.c: Support disas for Zcm* extensions
disas
Use pointer to pass more information of target to disasembler,
such as pass cpu.cfg related information in following commits.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
include/disas/dis-asm.h | 2 +-
1 file changed, 1 insertion(+), 1
Pass RISCVCPUConfig as disassemble_info.target_info to support disas
of conflict instructions related to specific extensions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
disas/riscv.c | 10 +++---
target/riscv/cpu.c | 1 +
2 files
Support disas for Z*inx instructions only when Zfinx extension is supported.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
disas/riscv.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/disas/riscv.c b/disas
Support disas for Zcmt* instructions only when related extensions
are supported.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
disas/riscv.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/disas/riscv.c b/disas
Fix lines with over 80 characters.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Daniel Henrique Barboza
---
disas/riscv.c | 201 +++---
1 file changed, 140 insertions(+), 61 deletions(-)
diff --git a/disas/riscv.c b/disas
On 2023/5/22 21:10, Daniel Henrique Barboza wrote:
In fact, apparently checkpatch.pl is not too happy about this patch:
On 5/18/23 23:19, Weiwei Li wrote:
Support disas for Zcmt* instructions only when related extensions
are supported.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
On 2023/5/22 21:00, Daniel Henrique Barboza wrote:
On 5/18/23 23:19, Weiwei Li wrote:
Support disas for Zcmt* instructions only when related extensions
are supported.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
disas/riscv.c | 20
1 file changed, 12
On 2023/5/22 20:54, Daniel Henrique Barboza wrote:
On 5/18/23 23:19, Weiwei Li wrote:
Pass RISCVCPUConfig as disassemble_info.target_info to support disas
of conflict instructions related to specific extensions.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
I suggest split
Support disas for Z*inx instructions only when Zfinx extension is supported.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
disas/riscv.c | 16
1 file changed, 12 insertions(+), 4 deletions(-)
diff --git a/disas/riscv.c b/disas/riscv.c
index 9e01810eef..a370bac6ef
Remove redundant parenthese and fix multi-line comments.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
disas/riscv.c | 219 +-
1 file changed, 110 insertions(+), 109 deletions(-)
diff --git a/disas/riscv.c b/disas/riscv.c
index
1 - 100 of 992 matches
Mail list logo