qemu-riscv
[Top][All Lists]
Advanced

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

Re: [PATCH 2/2] hw/intc: riscv_imsic: Refresh the CSRs xml after updatin


From: Weiwei Li
Subject: Re: [PATCH 2/2] hw/intc: riscv_imsic: Refresh the CSRs xml after updating the state of the cpu.
Date: Tue, 23 May 2023 22:43:41 +0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0


On 2023/5/23 19:44, Tommy Wu wrote:
Originally, when we set the ext_smaia to true, we still cannot print the
AIA CSRs in the remote gdb debugger, because the dynamic CSR xml is
generated when the cpu is realized.

This patch refreshes the dynamic CSR xml after we update the ext_smaia,
so that we can print the AIA CSRs in the remote gdb debugger.

Signed-off-by: Tommy Wu <tommy.wu@sifive.com>
Reviewed-by: Frank Chang <frank.chang@sifive.com>
---
  hw/intc/riscv_imsic.c | 4 ++++
  1 file changed, 4 insertions(+)

diff --git a/hw/intc/riscv_imsic.c b/hw/intc/riscv_imsic.c
index fea3385b51..97a51d535b 100644
--- a/hw/intc/riscv_imsic.c
+++ b/hw/intc/riscv_imsic.c
@@ -350,6 +350,10 @@ static void riscv_imsic_realize(DeviceState *dev, Error 
**errp)
          } else {
              rcpu->cfg.ext_smaia = true;
          }
+
+        /* Refresh the dynamic csr xml for the gdbstub. */
+        riscv_refresh_dynamic_csr_xml(cpu);
+

There is an assert in riscv_refresh_dynamic_csr_xml():

+    if (!cpu->dyn_csr_xml) {
+        g_assert_not_reached();
+    }

So I think riscv_refresh_dynamic_csr_xml() can only be called when cpu->dyn_csr_xml is true here.

Regards,

Weiwei Li

          riscv_cpu_set_aia_ireg_rmw_fn(env, (imsic->mmode) ? PRV_M : PRV_S,
                                        riscv_imsic_rmw, imsic);
      }




reply via email to

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