I intended to separate the S-mode and M-mode handling.
Do you think this change could improve performance?
Thanks,
Jay Chang
On Tue, Jul 1, 2025 at 11:46 AM Nutty Liu
wrote:
> On 7/1/2025 11:00 AM, Jay Chang wrote:
> > RISC-V AIA Spec states:
> > "For a machine-level en
updated predicate in aia_smode32.
Change log:
V3:
* Add cover letter
Jay Chang (2):
target/riscv: Restrict mideleg/medeleg/medelegh access to S-mode harts
target/riscv: Restrict midelegh access to S-mode harts
target/riscv/csr.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
--
2.48.1
deleg registers should not
exist."
Add smode predicate to ensure these CSRs are only accessible when S-mode
is supported.
Reviewed-by: Frank Chang
Reviewed-by: Alistair Francis
Signed-off-by: Jay Chang
---
target/riscv/csr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --gi
me as Smaia except
excluding the machine-level CSRs and behavior not directly visible to
supervisor level."
Since midelegh is an AIA machine-mode CSR, add Smaia extension check in
aia_smode32 predicate.
Reviewed-by: Frank Chang
Reviewed-by: Alistair Francis
Signed-off-by: Jay Chang
---
ta
Hi,
Gentle ping on this patch.
Thanks,
Jay Chang
On Tue, Apr 1, 2025 at 6:34 PM Jay Chang wrote:
> RISC-V Privileged Spec states:
> "In harts with S-mode, the medeleg and mideleg registers must exist, and
> setting a bit in medeleg or mideleg will delegate the corresponding
behavior.
A new CPU parameter num-pmp-regions has been introduced to the QEMU
command line. For example:
-cpu rv64, g=true, c=true, pmp=true, num-pmp-regions=8
Signed-off-by: Jay Chang
Reviewed-by: Frank Chang
---
target/riscv/cpu.c| 48
uld set its own default if they want.
(based on feedback from Daniel)
Jay Chang (2):
target/riscv: Extend PMP region up to 64
target/riscv: Make PMP region count configurable
target/riscv/cpu.c| 48 ++-
target/riscv/cpu.h| 3 +-
target/ri
According to the RISC-V Privileged Specification (version >1.12),
RV32 supports 16 CSRs (pmpcfg0–pmpcfg15) to configure 64 PMP regions
(pmpaddr0–pmpaddr63).
Signed-off-by: Jay Chang
Reviewed-by: Frank Chang
Reviewed-by: Alistair Francis
Reviewed-by: Daniel Henrique Barboza
---
target/ri
*Hi Daniel,*
You're absolutely right — thanks for pointing it out and providing the fix!
Would you like me to send out a v5 patch incorporating your changes?
Best Regards
Jay Chang
On Thu, Jun 5, 2025 at 2:20 AM Daniel Henrique Barboza <
dbarb...@ventanamicro.com> wrote:
>
pmp-regions`. This allows platforms to adjust
the number of PMP regions without relying on a fixed default value.
If unspecified, the default remains 16 to preserve compatibility.
Change log:
V3:
* Changed `pmp_regions` type from `uint16_t` to `uint8_t`
* Introduced `OLD_MAX_RISCV_PMPS` macro
behavior.
A new CPU parameter num-pmp-regions has been introduced to the QEMU
command line. For example:
-cpu rv64, g=true, c=true, pmp=true, num-pmp-regions=8
Signed-off-by: Jay Chang
Reviewed-by: Frank Chang
---
target/riscv/cpu.c| 54
According to the RISC-V Privileged Specification (version >1.12),
RV32 supports 16 CSRs (pmpcfg0–pmpcfg15) to configure 64 PMP regions
(pmpaddr0–pmpaddr63).
Signed-off-by: Jay Chang
Reviewed-by: Frank Chang
Reviewed-by: Alistair Francis
Reviewed-by: Daniel Henrique Barboza
---
target/ri
pmp-regions`. This allows platforms to adjust
the number of PMP regions without relying on a fixed default value.
If unspecified, the default remains 16 to preserve compatibility.
Change log:
V4:
* Changed `pmp_regions` type from `uint16_t` to `uint8_t`
* Introduced `OLD_MAX_RISCV_PMPS` macro
behavior.
A new CPU parameter num-pmp-regions has been introduced to the QEMU
command line. For example:
-cpu rv64, g=true, c=true, pmp=true, num-pmp-regions=8
Signed-off-by: Jay Chang
Reviewed-by: Frank Chang
---
target/riscv/cpu.c| 54
According to the RISC-V Privileged Specification (version >1.12),
RV32 supports 16 CSRs (pmpcfg0–pmpcfg15) to configure 64 PMP regions
(pmpaddr0–pmpaddr63).
Signed-off-by: Jay Chang
Reviewed-by: Frank Chang
Reviewed-by: Alistair Francis
Reviewed-by: Daniel Henrique Barboza
---
target/ri
According to the RISC-V Privileged Specification (version >1.12),
RV32 supports 16 CSRs (pmpcfg0–pmpcfg15) to configure 64 PMP regions
(pmpaddr0–pmpaddr63).
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/cpu_bits.h | 60 +++
target/riscv/csr.c |
pmp-regions`. This allows platforms to adjust
the number of PMP regions without relying on a fixed default value.
If unspecified, the default remains 16 to preserve compatibility.
change log:
V2:
* Rebase on riscv-to-apply.next
Jay Chang (2):
target/riscv: Extend PMP region up to 64
target/ri
behavior.
A new CPU parameter num-pmp-regions has been introduced to the QEMU
command line. For example:
-cpu rv64, g=true, c=true, pmp=true, num-pmp-regions=8
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/cpu.c| 54
I will send v2 patch
Jay Chang
On Thu, Apr 24, 2025 at 6:55 PM Alistair Francis
wrote:
> On Mon, Apr 21, 2025 at 7:48 PM Jay Chang wrote:
> >
> > Previously, the number of PMP regions was hardcoded to 16 in QEMU.
> > This patch replaces the fixed value with a ne
According to the RISC-V Privileged Specification (version >1.12),
RV32 supports 16 CSRs (pmpcfg0–pmpcfg15) to configure 64 PMP regions
(pmpaddr0–pmpaddr63).
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/cpu_bits.h | 60 +++
target/riscv/csr.c |
behavior.
A new CPU parameter num-pmp-regions has been introduced to the QEMU
command line. For example:
-cpu rv64, g=true, c=true, pmp=true, num-pmp-regions=8
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/cpu.c | 46
pmp-regions`. This allows platforms to adjust
the number of PMP regions without relying on a fixed default value.
If unspecified, the default remains 16 to preserve compatibility.
Jay Chang (2):
target/riscv: Extend PMP region up to 64
target/riscv: Make PMP region count configurable
target/ri
me as Smaia except
excluding the machine-level CSRs and behavior not directly visible to
supervisor level."
Since midelegh is an AIA machine-mode CSR, add Smaia extension check in
aia_smode32 predicate.
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/csr.c | 7 +--
1 fi
me as Smaia except
excluding the machine-level CSRs and behavior not directly visible to
supervisor level."
Since midelegh is an AIA machine-mode CSR, add Smaia extension check in
aia_smode32 predicate.
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/csr.c | 7 +--
1 fi
deleg registers should not
exist."
Add smode predicate to ensure these CSRs are only accessible when S-mode
is supported.
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/csr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/riscv/csr.c b/ta
enrique Barboza <
dbarb...@ventanamicro.com> wrote:
>
>
> On 3/18/25 4:01 AM, Jay Chang wrote:
> > RISC-V AIA Spec states:
> > "For a machine-level environment, extension Smaia encompasses all added
> > CSRs and all modifications to interrupt response behavior that
deleg registers should not
exist."
Add smode predicate to ensure these CSRs are only accessible when S-mode
is supported.
Reviewed-by: Frank Chang
Signed-off-by: Jay Chang
---
target/riscv/csr.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/target/riscv/csr.c b/ta
27 matches
Mail list logo