qemu-riscv
[Top][All Lists]
Advanced

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

Re: [RFC PATCH v5 2/3] riscv: Introduce custom CSR hooks to riscv_csrrw(


From: Richard Henderson
Subject: Re: [RFC PATCH v5 2/3] riscv: Introduce custom CSR hooks to riscv_csrrw()
Date: Fri, 22 Oct 2021 08:59:55 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0

On 10/22/21 1:34 AM, Ruinland ChuanTzu Tsai wrote:
+    /* Custom CSR value holder per hart */
+    void *custom_csr_val;
   };

Value singular?  Anyhow, I think that it's a mistake trying to hide the
value structure in another file.  It complicates allocation of the
CPURISCVState, and you have no mechanism by which to migrate the csr values.

What I'm trying to do here is to provide a hook for CSR value storage and let
it being set during CPU initilization. We have heterogeneous harts which
have different sets of CSRs.

I understand that, but the common CPURISCVState should contain the storage for all of the CSRs for every possible hart.

I might have made a different call if we had a more object-y language, but we have C. The difference in size (here exactly one word) is not worth the complication of splitting structures apart.


r~



reply via email to

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