condition between
textra.MHVALUE and mcontext CSR is also implemented.
Changes from v3:
- Simplify the comparison between mcontext and textra.MHVALUE
Changes from v2:
- Remove redundant log
Changes from v1:
- Log that mhselect only supports 0 or 4 for now
- Simplify writing of tdata3
Alvin Chang (2
.
For textra.MHSELECT field, the only legal values are 0 (ignore) and 4
(mcontext). Writing 1~3 into textra.MHSELECT will be changed to 0, and
writing 5~7 into textra.MHSELECT will be changed to 4. This behavior is
aligned to RISC-V SPIKE simulator.
Signed-off-by: Alvin Chang
Reviewed-by: Alistair
textra.MHVALUE with
mcontext CSR. The remaining fields, such as textra.SBYTEMASK,
textra.SVALUE, and textra.SSELECT, are hardwired to zero for now. Thus,
we skip checking them here.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 45 +++-
target/riscv
ask.
It seems the function of riscv_cpu_claim_interrupts() is no longer used.
Therefore, we remove it in this commit.
Signed-off-by: Alvin Chang
---
hw/intc/riscv_aclint.c| 20
hw/intc/riscv_aplic.c | 11 ---
hw/intc/riscv_imsic.c | 8
hw/intc/sifive_plic.c
.
For textra.MHSELECT field, the only legal values are 0 (ignore) and 4
(mcontext). Writing 1~3 into textra.MHSELECT will be changed to 0, and
writing 5~7 into textra.MHSELECT will be changed to 4. This behavior is
aligned to RISC-V SPIKE simulator.
Signed-off-by: Alvin Chang
Reviewed-by: Alistair
condition between
textra.MHVALUE and mcontext CSR is also implemented.
Changes from v2:
- Remove redundant log
Changes from v1:
- Log that mhselect only supports 0 or 4 for now
- Simplify writing of tdata3
Alvin Chang (2):
target/riscv: Preliminary textra trigger CSR writting support
target
textra.MHVALUE with
mcontext CSR. The remaining fields, such as textra.SBYTEMASK,
textra.SVALUE, and textra.SSELECT, are hardwired to zero for now. Thus,
we skip checking them here.
Signed-off-by: Alvin Chang
Reviewed-by: Alistair Francis
---
target/riscv/debug.c | 63
condition between
textra.MHVALUE and mcontext CSR is also implemented.
Changes from v1:
- Log that mhselect only supports 0 or 4 for now
- Simplify writing of tdata3
Alvin Chang (2):
target/riscv: Preliminary textra trigger CSR writting support
target/riscv: Add textra matching condition for the
.
For textra.MHSELECT field, the only legal values are 0 (ignore) and 4
(mcontext). Writing 1~3 into textra.MHSELECT will be changed to 0, and
writing 5~7 into textra.MHSELECT will be changed to 4. This behavior is
aligned to RISC-V SPIKE simulator.
Signed-off-by: Alvin Chang
---
target/riscv
textra.MHVALUE with
mcontext CSR. The remaining fields, such as textra.SBYTEMASK,
textra.SVALUE, and textra.SSELECT, are hardwired to zero for now. Thus,
we skip checking them here.
Signed-off-by: Alvin Chang
Reviewed-by: Alistair Francis
---
target/riscv/debug.c | 63
textra.MHVALUE with
mcontext CSR. The remaining fields, such as textra.SBYTEMASK,
textra.SVALUE, and textra.SSELECT, are hardwired to zero for now. Thus,
we skip checking them here.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 63 +++-
target/riscv
.
For textra.MHSELECT field, the only legal values are 0 (ignore) and 4
(mcontext). Writing 1~3 into textra.MHSELECT will be changed to 0, and
writing 5~7 into textra.MHSELECT will be changed to 4. This behavior is
aligned to RISC-V SPIKE simulator.
Signed-off-by: Alvin Chang
---
target/riscv
condition between
textra.MHVALUE and mcontext CSR is also implemented.
Alvin Chang (2):
target/riscv: Preliminary textra trigger CSR writting support
target/riscv: Add textra matching condition for the triggers
target/riscv/cpu_bits.h | 10 +++
target/riscv/debug.c| 144
nly load/store bits and loaded/stored address should be further checked
in riscv_cpu_debug_check_watchpoint().
Signed-off-by: Alvin Chang
Acked-by: Alistair Francis
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
Acked-by: Alistair Fr
v2:
- Explicitly mention the targeting version of RISC-V Debug Spec.
Changes from v1:
- Fix typo
- Add commit description for changing behavior of looping the triggers
when we check type 2 triggers.
Alvin Chang (3):
target/riscv: Add functions for common matching conditions of trigger
ases/tag/1.0.0-rc1-asciidoc
Signed-off-by: Alvin Chang
Reviewed-by: Alistair Francis
---
target/riscv/debug.c | 101 +--
1 file changed, 78 insertions(+), 23 deletions(-)
diff --git a/target/riscv/debug.c b/target/riscv/debug.c
index b110370e..11125f33 1006
From: Alvin Chang via
According to RISC-V Debug specification version 0.13 [1] (also applied
to version 1.0 [2] but it has not been ratified yet), there are several
common matching conditions before firing a trigger, including the
enabled privilege levels of the trigger.
This commit adds
From: Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
Ack
From: Alvin Chang via
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level.
Remove the related code in riscv_cpu_debug_check_watchpoint() and invoke
trigger_common_match() to check the privilege levels o
v2:
- Explicitly mention the targeting version of RISC-V Debug Spec.
Changes from v1:
- Fix typo
- Add commit description for changing behavior of looping the triggers
when we check type 2 triggers.
Alvin Chang (3):
target/riscv: Add functions for common matching conditions of trigger
nly load/store bits and loaded/stored address should be further checked
in riscv_cpu_debug_check_watchpoint().
Signed-off-by: Alvin Chang
Acked-by: Alistair Francis
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
Acked-by: Alistair Fr
https://github.com/riscv/riscv-debug-spec/releases/tag/1.0.0-rc1-asciidoc
Signed-off-by: Alvin Chang
Reviewed-by: Alistair Francis
---
target/riscv/debug.c | 70
1 file changed, 70 insertions(+)
diff --git a/target/riscv/debug.c b/target/riscv/debug.c
Only the execution bit and the executed PC should be futher checked in
riscv_cpu_debug_check_breakpoint().
Signed-off-by: Alvin Chang
Reviewed-by: Alistair Francis
---
target/riscv/debug.c | 31 ---
1 file changed, 8 insertions(+), 23 deletions(-)
diff --git a/targ
Spec.
Changes from v1:
- Fix typo
- Add commit description for changing behavior of looping the triggers
when we check type 2 triggers.
Alvin Chang (4):
target/riscv: Add functions for common matching conditions of trigger
target/riscv: Apply modularized matching conditions for breakpoint
https://github.com/riscv/riscv-debug-spec/releases/tag/1.0.0-rc1-asciidoc
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 70
1 file changed, 70 insertions(+)
diff --git a/target/riscv/debug.c b/target/riscv/debug.c
index e30d99cc2f..3891236b82 100644
nly load/store bits and loaded/stored address should be further checked
in riscv_cpu_debug_check_watchpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv/debug.c b/target/riscv
description for changing behavior of looping the triggers
when we check type 2 triggers.
Alvin Chang (4):
target/riscv: Add functions for common matching conditions of trigger
target/riscv: Apply modularized matching conditions for breakpoint
target/riscv: Apply modularized matching conditions
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 2
Only the execution bit and the executed PC should be futher checked in
riscv_cpu_debug_check_breakpoint().
Signed-off-by: Alvin Chang
Reviewed-by: Alistair Francis
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv/d
targeting version of RISC-V Debug Spec.
Changes from v1:
- Fix typo
- Add commit description for changing behavior of looping the triggers
when we check type 2 triggers.
Alvin Chang (4):
target/riscv: Add functions for common matching conditions of trigger
target/riscv: Apply modularized matching
Only the execution bit and the executed PC should be futher checked in
riscv_cpu_debug_check_breakpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv/debug.c b/target/riscv/debug
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 2
nly load/store bits and loaded/stored address should be further checked
in riscv_cpu_debug_check_watchpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv/debug.c b/target/riscv
now, we just implement
trigger_priv_match() to check if the enabled privilege levels of the
trigger match CPU's current privilege level.
[1]: https://github.com/riscv/riscv-debug-spec/releases/tag/1.0.0-rc1-asciidoc
Signed-off-by: Alvin Chang
---
target/riscv/debug.c
implement
trigger_priv_match() to check if the enabled privilege levels of the
trigger match CPU's current privilege level.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 70
1 file changed, 70 insertions(+)
diff --git a/target/riscv/debu
trigger_priv_match().
Additional match conditions, such as CSR tcontrol and textra, can be
further implemented into trigger_common_match() in the future.
Changes from v1:
- Fix typo
- Add commit description for changing behavior of looping the triggers
when we check type 2 triggers.
Alvin Chang (4
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 2
nly load/store bits and loaded/stored address should be further checked
in riscv_cpu_debug_check_watchpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv/debug.c b/target/riscv
Only the execution bit and the executed PC should be futher checked in
riscv_cpu_debug_check_breakpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/riscv/debug.c b/target/riscv/debug
implement
trigger_priv_match() to check if the enabled privilege levels of the
trigger match CPU's current privilege level.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 70
1 file changed, 70 insertions(+)
diff --git a/target/riscv/debu
trigger_priv_match().
Additional match conditions, such as CSR tcontrol and textra, can be
further implemented into trigger_common_match() in the future.
Alvin Chang (4):
target/riscv: Add functions for common matching conditions of trigger
target/riscv: Apply modularized matching conditions for
ype 6 triggers for the watchpoints.
Only load/store bits and loaded/stored address should be further checked
in riscv_cpu_debug_check_watchpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/
ype 6 triggers for the breakpoints.
Only the execution bit and the executed PC should be futher checked in
riscv_cpu_debug_check_breakpoint().
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 26 ++
1 file changed, 6 insertions(+), 20 deletions(-)
diff --git a/target/
We have implemented trigger_common_match(), which checks if the enabled
privilege levels of the trigger match CPU's current privilege level. We
can invoke trigger_common_match() to check the privilege levels of the
type 3 triggers.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 2
tech-debug/topic/102702615#1461
The debug specification does not mention the operation to tcontrol.MPTE
when "mret" is executed. Therefore, we just keep its current value.
Signed-off-by: Alvin Chang
---
target/riscv/op_helper.c | 6 ++
1 file changed, 6 insertions(+)
diff
The RISC-V debug specification defines an optional CSR "tcontrol" within
the trigger module. This commit adds its read/write operations and
related bit-field definitions.
Signed-off-by: Alvin Chang
---
target/riscv/cpu.h | 1 +
target/riscv/cpu_bits.h | 3 +++
target/r
-by: Alvin Chang
---
target/riscv/cpu_helper.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/target/riscv/cpu_helper.c b/target/riscv/cpu_helper.c
index d462d95ee1..037ae21062 100644
--- a/target/riscv/cpu_helper.c
+++ b/target/riscv/cpu_helper.c
@@ -1806,6 +1806,12 @@ v
The RISC-V Debug specification defines CSR "tcontrol" in the trigger
module:
https://github.com/riscv/riscv-debug-spec
This series implements it and the related operations.
Alvin Chang (4):
target/riscv: Add CSR tcontrol of debug trigger module
target/riscv: Reset CSR tcontro
When the trigger module resets, reset the value of CSR tcontrol as zero.
Signed-off-by: Alvin Chang
---
target/riscv/debug.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/target/riscv/debug.c b/target/riscv/debug.c
index e30d99cc2f..e3832a643e 100644
--- a/target/riscv/debug.c
+++ b
The debug Sdtrig extension defines an CSR "mcontext". This commit
implements its predicate and read/write operations into CSR table.
Its value is reset as 0 when the trigger module is reset.
Signed-off-by: Alvin Chang
---
Changes from v1: Remove dedicated cfg, always implement mcontext
are also implemented into CSR table. Its value is reset as 0
when the trigger module is reset.
Signed-off-by: Alvin Chang
---
target/riscv/cpu.c | 4
target/riscv/cpu.h | 1 +
target/riscv/cpu_bits.h | 7 +++
target/riscv/cpu_cfg.h | 1 +
scv: update checks on writing pmpcfg for
> Smepmp to version 1.0
>
> On Tue, Nov 14, 2023 at 12:24 PM Alvin Chang via
> wrote:
> >
> > Current checks on writing pmpcfg for Smepmp follows Smepmp version
> > 0.9.1. However, Smepmp specification has already been ra
of pmpcfg into the index of the Smepmp
truth
> table, and checks the rules by aforementioned specification changes.
>
> Signed-off-by: Alvin Chang
> ---
> Changes from v4: Rebase on master.
>
> Changes from v3: Modify "epmp_operation" to "smepmp_operation&q
-Region is not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the Smepmp
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
Changes from v4: Rebase on master
-Region is not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the Smepmp
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
Changes from v3: Modify
-Region is not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the Smepmp
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
Changes from v2: Adopt switch case
-Region is not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the Smepmp
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
Changes from v1: Convert ePMP over
-Region is not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the Smepmp
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
Changes from v1: Convert ePMP over
-Region is not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the Smepmp
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
Changes from v1: Convert ePMP over
Fix the inverted order of pmpaddr13 and pmpaddr14 in csr_name().
Signed-off-by: Alvin Chang
---
disas/riscv.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/disas/riscv.c b/disas/riscv.c
index 3873a69157..8e89e1d115 100644
--- a/disas/riscv.c
+++ b/disas/riscv.c
not possible and such pmpcfg writes are
ignored, leaving pmpcfg unchanged.
The commit transfers the value of pmpcfg into the index of the ePMP
truth table, and checks the rules by aforementioned specification
changes.
Signed-off-by: Alvin Chang
---
target/riscv/pmp.c | 51
63 matches
Mail list logo