Separate c_fld/c_fsd from fld/fsd to add additional check for
c.fld{sp}/c.fsd{sp} which is useful for zcmp/zcmt to reuse
their encodings
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode
Add encode and trans* functions support for Zcb instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 24 ++
target/riscv/insn_trans/trans_rvzce.c.inc | 100
Add properties for Zca,Zcb,Zcf,Zcd,Zcmp,Zcmt extension
Add check for these properties
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 43 +++
target/riscv/cpu.h
Add encode and trans* functions support for Zcb instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 24 ++
target/riscv/insn_trans/trans_rvzce.c.inc | 100
fsd{sp} before support of zcmp/zcmt
Weiwei Li (9):
target/riscv: add cfg properties for Zc* extension
target/riscv: add support for Zca extension
target/riscv: add support for Zcf extension
target/riscv: add support for Zcd extension
target/riscv: add support for Zcb extension
targ
Modify the check for C extension to Zca (C implies Zca)
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
Reviewed-by: Wilfred Mallawa
---
target/riscv/insn_trans/trans_rvi.c.inc | 4 ++--
target/riscv/translate.c
Add encode, trans* functions for Zcmp instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 18 +++
target/riscv/insn_trans/trans_rvzce.c.inc | 189
Expose zca,zcb,zcf,zcd,zcmp,zcmt properties
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 3d06b57416..5f03698b3b 100644
Separate c_flw/c_fsw from flw/fsw to add check for Zcf extension
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode | 8
target/riscv/insn_trans/trans_rvf.c.inc | 18
Separate c_fld/c_fsd from fld/fsd to add additional check for
c.fld{sp}/c.fsd{sp} which is useful for zcmp/zcmt to reuse
their encodings
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode
Add encode, trans* functions and helper functions support for Zcmt
instrutions
Add support for jvt csr
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/cpu.h| 4 ++
target/riscv
Zcmp/Zcmt instructions will override disasm for c.fld*/c.fsd*
instructions currently
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Acked-by: Alistair Francis
---
disas/riscv.c | 287 +-
1 file changed, 286 insertions(+), 1 deletion
Add encode and trans* functions support for Zcb instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 24 ++
target/riscv/insn_trans/trans_rvzce.c.inc | 100
Separate c_fld/c_fsd from fld/fsd to add additional check for
c.fld{sp}/c.fsd{sp} which is useful for zcmp/zcmt to reuse
their encodings
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode
eparate c.fld{sp}/fsd{sp} with fld{sp}/fsd{sp} before support of zcmp/zcmt
Weiwei Li (9):
target/riscv: add cfg properties for Zc* extension
target/riscv: add support for Zca extension
target/riscv: add support for Zcf extension
target/riscv: add support for Zcd extension
target/riscv:
Modify the check for C extension to Zca (C implies Zca)
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
Reviewed-by: Wilfred Mallawa
---
target/riscv/insn_trans/trans_rvi.c.inc | 4 ++--
target/riscv/translate.c
Separate c_flw/c_fsw from flw/fsw to add check for Zcf extension
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode | 8
target/riscv/insn_trans/trans_rvf.c.inc | 18
Zcmp/Zcmt instructions will override disasm for c.fld*/c.fsd*
instructions currently
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Acked-by: Alistair Francis
---
disas/riscv.c | 228 +-
1 file changed, 227 insertions(+), 1 deletion
Add properties for Zca,Zcb,Zcf,Zcd,Zcmp,Zcmt extension
Add check for these properties
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 43 +++
target/riscv/cpu.h
Add encode, trans* functions and helper functions support for Zcmt
instrutions
Add support for jvt csr
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/cpu.h| 4 ++
target/riscv
Add encode, trans* functions for Zcmp instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 18 +++
target/riscv/insn_trans/trans_rvzce.c.inc | 189
Expose zca,zcb,zcf,zcd,zcmp,zcmt properties
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 3d06b57416..5f03698b3b 100644
.min_priv_ver = PRIV_VERSION_1_12_0
},
+/* Smstateen extension CSRs */
+[CSR_MSTATEEN0] = { "mstateen0", mstateen, read_mstateen, write_mstateen0,
+ .min_priv_ver = PRIV_VERSION_1_12_0 },
The new lines have been upd
his check into the predicate.
By the way, sharing the same function for all related csrs is easily
misunderstood. However, It seems correct.
Regards,
Weiwei Li
+if (ret != RISCV_EXCP_NONE) {
+return ret;
+}
+
*val = env->senvcfg;
return RISCV_EXCP_NONE;
}
@@
turn false; \
+} \
} \
} while (0)
SMSTATEEN_CHECK is for CSR. and REQUIRE_ZFINX_OR_F is for Extension.
I think It's better to separate them. By the way, if we want the smallest
modification
for current code, adding it to REQUIRE_FPU seems better.
Regards,
Weiwei Li
diff --git a/
tting hstateen0 bit 58 to zero prevents a virtual machine from
accessing the hart’s IMSIC the same as
setting hstatus.VGEIN = 0"
I think it means "setting hstateen0 bit 58 to zero" and "setting
hstatus.VGEIN = 0" have the same function:
" prevents a virtua
PROP_BOOL("smstateen", RISCVCPU, cfg.ext_smstateen, false),
DEFINE_PROP_BOOL("svinval", RISCVCPU, cfg.ext_svinval, false),
DEFINE_PROP_BOOL("svnapot", RISCVCPU, cfg.ext_svnapot, false),
DEFINE_PROP_BOOL("svpbmt", RISCVCPU, cfg.ext_svpbmt, false),
Reviewed-by: Weiwei Li
Regards,
Weiwei Li
在 2022/7/24 下午11:39, Mayuresh Chitale 写道:
On Fri, 2022-07-22 at 08:31 +0800, Weiwei Li wrote:
在 2022/7/21 下午11:31, Mayuresh Chitale 写道:
Smstateen extension specifies a mechanism to close
the potential covert channels that could cause security issues.
This patch adds the CSRs defined in the
在 2022/7/24 下午11:49, Mayuresh Chitale 写道:
On Fri, 2022-07-22 at 09:42 +0800, Weiwei Li wrote:
在 2022/7/21 下午11:31, Mayuresh Chitale 写道:
If smstateen is implemented and sstateen0.fcsr is clear then the
floating point operations must return illegal instruction
exception.
Signed-off-by
在 2022/7/27 上午7:34, Atish Patra 写道:
On Wed, Jul 20, 2022 at 9:32 PM Alistair Francis wrote:
On Sat, Jul 2, 2022 at 11:42 PM Weiwei Li wrote:
- improve the field extract progress
This part is already improved with the PMU series.
https://www.mail-archive.com/qemu-devel@nongnu.org
T31]= { "mhpmevent31",any, read_mhpmevent,
write_mhpmevent },
+[CSR_MHPMEVENT3H]= { "mhpmevent3h",sscofpmf, read_mhpmeventh,
+
ycles/instructions */
Reviewed-by: Weiwei Li
Regards,
Weiwei Li
mhpmeventh,
+ .min_priv_ver = PRIV_VERSION_1_12_0 },
Similar to the first commit, it's better to align with the first element
"mhpmevent3h" .Otherwise,
Reviewed-by: Weiwei Li
Regards,
Weiwei Li
[CSR_MHPMEVENT4H]= { "mhpmevent4h&q
ed here. In original logic,
RISCV_EXCP_VIRT_INSTRUCTION_FAULT is triggered when
!get_field(env->hcounteren, 1 << ctr_index) && get_field(env->mcounteren, 1 <<
ctr_index)
The new logic is RISCV_EXCP_VIRT_INSTRUCTION_FAULT is triggered when
!get_field(env->mcounteren, ctr_mask)
or !get_field(env->hcounteren, 1 << ctr_index) && get_field(env->mcounteren, 1
<< ctr_index)
Regards,
Weiwei Li
}
#endif
在 2022/7/28 上午5:40, Atish Kumar Patra 写道:
On Wed, Jul 27, 2022 at 1:35 AM Weiwei Li <mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/7/27 下午2:49, Atish Patra 写道:
> All the hpmcounters and the fixed counters (CY, IR, TM) can be
represented
> as a unified cou
在 2022/7/28 下午2:15, Mayuresh Chitale 写道:
On Mon, 2022-07-25 at 15:23 +0800, Weiwei Li wrote:
在 2022/7/24 下午11:49, Mayuresh Chitale 写道:
On Fri, 2022-07-22 at 09:42 +0800, Weiwei Li wrote:
在 2022/7/21 下午11:31, Mayuresh Chitale 写道:
If smstateen is implemented and sstateen0.fcsr is clear then
在 2022/7/28 下午2:41, Mayuresh Chitale 写道:
On Fri, 2022-07-22 at 08:45 +0800, Weiwei Li wrote:
在 2022/7/21 下午11:31, Mayuresh Chitale 写道:
Accesses to henvcfg, henvcfgh and senvcfg are allowed only if
corresponding bit in mstateen0/hstateen0 is enabled. Otherwise an
illegal instruction trap is
values for RV32*/
+target_ulong mhpmeventh_val[RV_MAX_MHPMEVENTS];
+
I think mhpmeventh_val can be uint32_t directly. Or use the usual way
to implement this type of CSRs:
change the type of mhpmevent_val to uint64_t and mhpmeventh csr reuse
the high part of
mhpmeventh_val for R
mode, it will always
be allowed. So I think we should add check for current priv is less
than M mode here.
Similar to sstateen.
Regards,
Weiwei Li
+return hmode(env, csrno);
+}
+
+static RISCVException hstateen(CPURISCVState *env, int csrno)
+{
+return hstateen_pred(env,
EXCP_VIRT_INSTRUCTION_FAULT instead if "!(env->sstateen[index] & bit)"
here.
Regards,
Weiwei Li
+}
+
+return RISCV_EXCP_NONE;
+}
+#endif
+
static RISCVException fs(CPURISCVState *env, int csrno)
{
#if !defined(CONFIG_USER_ONLY)
@@ -1715,6 +1747,13 @@ static RISCV
is not existed(that is misa.F is zero and Zfinx is not
supported). However, when FCSR is exsited,
the final exception should be decided by current privilege level and the
stateen related csr values just
like the access control of FCSR.
Regards,
Weiwei Li
Signed-off-by: Mayuresh Chitale
77,13 @@ static void riscv_cpu_realize(DeviceState *dev, Error
**errp)
set_resetvec(env, cpu->cfg.resetvec);
+#ifndef CONFIG_USER_ONLY
+if (cpu->cfg.ext_sstc) {
+riscv_timer_init(cpu);
+ }
+#endif /* CONFIG_USER_ONLY */
+
+
multi blink line here.
Regards,
Weiwei Li
/
ink hcounteren only works for VS mode here. So we should add check
for virt mode is enabled here.
+return RISCV_EXCP_NONE;
+}
It's better to return hmode(env, csrno) instead of RISCV_EXCP_NONE here.
Regards,
Weiwei Li
+
+static RISCVException read_vstimecmp(CPURISCVState
: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/csr.c | 44 +---
1 file changed, 25 insertions(+), 19 deletions(-)
diff --git a/target/riscv/csr.c b/target/riscv/csr.c
index 0fb042b2fd..d81f466c80 100644
--- a/target/riscv/csr.c
+++ b/target/riscv
在 2022/8/4 上午5:05, Atish Kumar Patra 写道:
On Wed, Aug 3, 2022 at 1:49 AM Weiwei Li <mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/8/3 下午4:25, Atish Patra 写道:
> vstimecmp CSR allows the guest OS or to program the next guest timer
> interrupt directly. Thus, hyper
在 2022/8/4 上午11:38, Anup Patel 写道:
On Wed, Aug 3, 2022 at 6:16 PM Weiwei Li wrote:
Normally, riscv_csrrw_check is called when executing Zicsr instructions.
And we can only do access control for existed CSRs. So the priority of
CSR related check, from highest to lowest, should be as follows
.min_priv_ver = PRIV_VERSION_1_12_0
},
[CSR_STIMECMPH] = { "stimecmph", sstc, read_stimecmph, write_stimecmph,
.min_priv_ver = PRIV_VERSION_1_12_0
},
+[CSR_VSTIMECMP] = { "vstimecmp", sstc_hmode, read_vstimecmp,
+
在 2022/8/9 上午1:20, Atish Kumar Patra 写道:
On Sun, Aug 7, 2022 at 6:50 PM Weiwei Li <mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/8/4 上午9:42, Atish Patra 写道:
> vstimecmp CSR allows the guest OS or to program the next guest timer
> interrupt directly. Thus, hyper
在 2022/8/10 上午3:34, Atish Kumar Patra 写道:
On Tue, Aug 9, 2022 at 12:01 AM Weiwei Li <mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/8/9 上午1:20, Atish Kumar Patra 写道:
On Sun, Aug 7, 2022 at 6:50 PM Weiwei Li mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/8/
在 2022/8/10 下午1:45, Atish Kumar Patra 写道:
On Tue, Aug 9, 2022 at 6:33 PM Weiwei Li <mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/8/10 上午3:34, Atish Kumar Patra 写道:
On Tue, Aug 9, 2022 at 12:01 AM Weiwei Li mailto:liwei...@iscas.ac.cn>> wrote:
在 2022/8/
+++
6 files changed, 118 insertions(+), 6 deletions(-)
LGTM.
Reviewed-by: Weiwei Li
Regards,
Weiwei Li
diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 4cda2905661e..1fd382b2717f 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -312,6 +312,8 @@ struct CPUArchState
: 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
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
_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
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
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(-
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
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
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/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
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:
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 |
instead of helper for push/pop
v2:
* add check for relationship between Zca/Zcf/Zcd with C/F/D based on related
discussion in review of Zc* spec
* separate c.fld{sp}/fsd{sp} with fld{sp}/fsd{sp} before support of zcmp/zcmt
Weiwei Li (9):
target/riscv: add cfg properties for Zc* extension
Zcmp/Zcmt instructions will override disasm for c.fld*/c.fsd*
instructions currently
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Acked-by: Alistair Francis
---
disas/riscv.c | 228 +-
1 file changed, 227 insertions(+), 1 deletion
Separate c_fld/c_fsd from fld/fsd to add additional check for
c.fld{sp}/c.fsd{sp} which is useful for zcmp/zcmt to reuse
their encodings
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode
Add encode, trans* functions and helper functions support for Zcmt
instrutions
Add support for jvt csr
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/cpu.h| 4 ++
target/riscv
Expose zca,zcb,zcf,zcd,zcmp,zcmt properties
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 13 +
1 file changed, 13 insertions(+)
diff --git a/target/riscv/cpu.c b/target/riscv/cpu.c
index 39ab7e46d3..6df667805f 100644
Add properties for Zca,Zcb,Zcf,Zcd,Zcmp,Zcmt extension
Add check for these properties
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/cpu.c | 43 +++
target/riscv/cpu.h
Add encode and trans* functions support for Zcb instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 24 ++
target/riscv/insn_trans/trans_rvzce.c.inc | 100
Modify the check for C extension to Zca (C implies Zca)
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
Reviewed-by: Wilfred Mallawa
---
target/riscv/insn_trans/trans_rvi.c.inc | 4 ++--
target/riscv/translate.c
Separate c_flw/c_fsw from flw/fsw to add check for Zcf extension
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode | 8
target/riscv/insn_trans/trans_rvf.c.inc | 18
Add encode, trans* functions for Zcmp instructions
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: Alistair Francis
---
target/riscv/insn16.decode| 18 +++
target/riscv/insn_trans/trans_rvzce.c.inc | 189
Fix lines with over 80 characters for both code and comments in
vector_helper.c, pmp.c and pmu.c.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/pmp.c | 6 ++-
target/riscv/pmu.c | 3 +-
target/riscv/vector_helper.c | 76
The assignment is done under the condition riscv_cpu_virt_enabled()=true.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index
Fix formats for multi-lines comments.
Add spaces around single line comments(after "/*" and before "*/").
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/arch_dump.c| 3 +-
target/riscv/cpu.c | 2 +-
Since env->virt.VIRT_ONOFF is initialized as false, and will not be set
to true when RVH is disabled, so we can just return this bit(false) when
RVH is not disabled.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 4
1 file changed, 4 deleti
Fix identation problems, and try to use the same indentation strategy
in the same file.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/arch_dump.c| 4 +-
target/riscv/cpu.c | 4 +-
target/riscv/cpu_helper.c | 15
Check on riscv_cpu_virt_enabled contains the check on RVH.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/op_helper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/riscv/op_helper.c b/target/riscv/op_helper.c
index 84ee018f7d..1eecae9547
This patchset tries to simplify the RVH related check and fix some code style
problems, such as problems for indentation, multi-line comments and lines with
over 80 characters.
The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-cleanup-upstream
Weiwei Li (8):
target
Remove redundant parentheses in get_physical_address.
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/cpu_helper.c b/target/riscv/cpu_helper.c
index 3862e7b677..de2d4a8c1d
In current implementation, riscv_cpu_set_virt_enabled is only called when
RVH is enabled.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu_helper.c | 4
1 file changed, 4 deletions(-)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index
Remove redundant parentheses in get_physical_address.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: LIU Zhiwei
---
target/riscv/cpu_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/cpu_helper.c b
From: LIU Zhiwei
Currently we only use the env->virt to encode the virtual mode enabled
status. Let's make it a bool type.
Signed-off-by: LIU Zhiwei
Reviewed-by: Weiwei Li
Message-ID: <20230325145348.1208-1-zhiwei_...@linux.alibaba.com>
---
target/riscv/cpu.h| 2 +-
Check on riscv_cpu_virt_enabled contains the check on RVH.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: LIU Zhiwei
---
target/riscv/op_helper.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/target/riscv/op_helper.c
Directly use env->virt_enabled instead.
Suggested-by: LIU Zhiwei
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.c| 2 +-
target/riscv/cpu.h| 1 -
target/riscv/cpu_helper.c | 51 ++-
target/riscv/cs
Fix lines with over 80 characters for both code and comments in
vector_helper.c, pmp.c and pmu.c.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: LIU Zhiwei
---
target/riscv/pmp.c | 6 ++-
target/riscv/pmu.c | 3 +-
target/riscv/vector_helper.c | 76
Fix identation problems, and try to use the same indentation strategy
in the same file.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: LIU Zhiwei
---
target/riscv/arch_dump.c| 4 +-
target/riscv/cpu.c | 4 +-
target/riscv
The assignment is done under the condition riscv_cpu_virt_enabled()=true.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: LIU Zhiwei
---
target/riscv/cpu_helper.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/target
bled() in patch 6
(suggested by LIU Zhiwei)
* remain the orginal identation for macro name in patch 8 (suggested by LIU
Zhiwei)
LIU Zhiwei (1):
target/riscv: Convert env->virt to a bool env->virt_enabled
Weiwei Li (9):
target/riscv: Remove redundant call to riscv_cpu_virt_enabled
targe
In current implementation, riscv_cpu_set_virt_enabled is only called when
RVH is enabled.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: LIU Zhiwei
---
target/riscv/cpu_helper.c | 5 +
1 file changed, 1 insertion(+), 4 deletions(-)
diff
Since env->virt.VIRT_ONOFF is initialized as false, and will not be set
to true when RVH is disabled, so we can just return this bit(false) when
RVH is not disabled.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Reviewed-by: Richard Henderson
Reviewed-by: LIU Zhiwei
---
target/ri
Fix formats for multi-lines comments.
Add spaces around single line comments(after "/*" and before "*/").
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Acked-by: Richard Henderson
Reviewed-by: LIU Zhiwei
---
target/riscv/arch_dump.c| 3 +-
actual_address = (requested_address & ~mpmmask) | mpmbase.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/vector_helper.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index 2423af
This patchset tries to fix some problems in current implementation for pointer
mask extension, and add support for pointer mask of instruction fetch.
The port is available here:
https://github.com/plctlab/plct-qemu/tree/plct-pm-fix
Weiwei Li (5):
target/riscv: Fix effective address for pointer
Since pointer mask works on effective address, and the xl works on the
generation of effective address, so xl related calculation should be done
before pointer mask.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/translate.c | 16
1 file changed, 12
Sign-extend the vector address when xl = 32.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/vector_helper.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/target/riscv/vector_helper.c b/target/riscv/vector_helper.c
index a58d82af8c..07477663eb 100644
--- a
Currently, the pc use signed-extend(in gen_set_pc*) when xl = 32. And
data address should use the same memory address space with it when
xl = 32. So we should change their address calculation to use sign-extended
address when xl = 32.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
Transform the fetch address before page walk when pointer mask is
enabled for instruction fetch.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.h| 1 +
target/riscv/cpu_helper.c | 25 +++--
target/riscv/csr.c| 2 --
3 files
Transform the fetch address in cpu_get_tb_cpu_state() when pointer
mask for instruction is enabled.
Enable PC-relative translation when J is enabled.
Signed-off-by: Weiwei Li
Signed-off-by: Junqiang Wang
---
target/riscv/cpu.c| 4
target/riscv/cpu.h| 1 +
target/riscv
problems
* Add patch 4 and 5 to use PC-relative translation for pointer mask for
instruction fetch
Weiwei Li (5):
target/riscv: Fix pointer mask transformation for vector address
target/riscv: Update cur_pmmask/base when xl changes
target/riscv: Sync cpu_pc before update badaddr
target/riscv: Add
101 - 200 of 992 matches
Mail list logo