qemu-riscv
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v3 16/21] target/riscv: adding high part of some csrs


From: Richard Henderson
Subject: Re: [PATCH v3 16/21] target/riscv: adding high part of some csrs
Date: Wed, 20 Oct 2021 16:03:50 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/19/21 2:48 AM, Frédéric Pétrot wrote:
Adding the high part of a minimal set of csr.

Signed-off-by: Frédéric Pétrot <frederic.petrot@univ-grenoble-alpes.fr>
Co-authored-by: Fabien Portas <fabien.portas@grenoble-inp.org>
---
  target/riscv/cpu.h | 7 +++++++
  1 file changed, 7 insertions(+)

diff --git a/target/riscv/cpu.h b/target/riscv/cpu.h
index 8b96ccb37a..27ec4fec63 100644
--- a/target/riscv/cpu.h
+++ b/target/riscv/cpu.h
@@ -192,6 +192,13 @@ struct CPURISCVState {
      target_ulong hgatp;
      uint64_t htimedelta;
+ /* Upper 64-bits of 128-bit CSRs */
+    uint64_t mtvech;
+    uint64_t mscratchh;
+    uint64_t mepch;
+    uint64_t satph;
+    uint64_t mstatush;

There's nothing defined for mstatush (except SD), so we might as well leave it out until there is. The only thing required there is that we put SD in the correct place when we compute it from lower bits on read.

mepch and mtvech do not need extending until we extend pc.

I don't see a definition of how satph extends, and since you're not changing the rv64 virtual memory routines nothing will examine it anyway. Let's drop that.

Which leaves mscratchh and maybe sscratchh as the only "real" 128-bit csrs.
Which suggests that the support that you do add in the next patch does not need to be quite as complicated. E.g. drop the op128 hook.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]