All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] loongarch fix for 9.0
@ 2024-03-22 10:03 Song Gao
  2024-03-22 10:03 ` [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' Song Gao
  2024-03-22 12:58 ` [PULL 0/1] loongarch fix for 9.0 Peter Maydell
  0 siblings, 2 replies; 5+ messages in thread
From: Song Gao @ 2024-03-22 10:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, mjt

The following changes since commit fea445e8fe9acea4f775a832815ee22bdf2b0222:

  Merge tag 'pull-maintainer-final-for-real-this-time-200324-1' of https://gitlab.com/stsquad/qemu into staging (2024-03-21 10:31:56 +0000)

are available in the Git repository at:

  https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240322

for you to fetch changes up to 1590154ee4376819a8c6ee61e849ebf4a4e7cd02:

  target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' (2024-03-22 17:57:49 +0800)

----------------------------------------------------------------
pull-loongarch-20240322

----------------------------------------------------------------
Song Gao (1):
      target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'

 target/loongarch/cpu.c | 74 +++++++++++++++++++++++++++-----------------------
 1 file changed, 40 insertions(+), 34 deletions(-)



^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'
  2024-03-22 10:03 [PULL 0/1] loongarch fix for 9.0 Song Gao
@ 2024-03-22 10:03 ` Song Gao
  2024-03-22 14:58   ` Michael Tokarev
  2024-03-22 12:58 ` [PULL 0/1] loongarch fix for 9.0 Peter Maydell
  1 sibling, 1 reply; 5+ messages in thread
From: Song Gao @ 2024-03-22 10:03 UTC (permalink / raw)
  To: qemu-devel; +Cc: peter.maydell, mjt, Philippe Mathieu-Daudé

qemu-system-loongarch64 assert failed with the option '-d int',
the helper_idle() raise an exception EXCP_HLT, but the exception name is undefined.

Signed-off-by: Song Gao <gaosong@loongson.cn>
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20240321123606.1704900-1-gaosong@loongson.cn>
---
 target/loongarch/cpu.c | 74 +++++++++++++++++++++++-------------------
 1 file changed, 40 insertions(+), 34 deletions(-)

diff --git a/target/loongarch/cpu.c b/target/loongarch/cpu.c
index f6ffb3aadb..203a349055 100644
--- a/target/loongarch/cpu.c
+++ b/target/loongarch/cpu.c
@@ -45,33 +45,45 @@ const char * const fregnames[32] = {
     "f24", "f25", "f26", "f27", "f28", "f29", "f30", "f31",
 };
 
-static const char * const excp_names[] = {
-    [EXCCODE_INT] = "Interrupt",
-    [EXCCODE_PIL] = "Page invalid exception for load",
-    [EXCCODE_PIS] = "Page invalid exception for store",
-    [EXCCODE_PIF] = "Page invalid exception for fetch",
-    [EXCCODE_PME] = "Page modified exception",
-    [EXCCODE_PNR] = "Page Not Readable exception",
-    [EXCCODE_PNX] = "Page Not Executable exception",
-    [EXCCODE_PPI] = "Page Privilege error",
-    [EXCCODE_ADEF] = "Address error for instruction fetch",
-    [EXCCODE_ADEM] = "Address error for Memory access",
-    [EXCCODE_SYS] = "Syscall",
-    [EXCCODE_BRK] = "Break",
-    [EXCCODE_INE] = "Instruction Non-Existent",
-    [EXCCODE_IPE] = "Instruction privilege error",
-    [EXCCODE_FPD] = "Floating Point Disabled",
-    [EXCCODE_FPE] = "Floating Point Exception",
-    [EXCCODE_DBP] = "Debug breakpoint",
-    [EXCCODE_BCE] = "Bound Check Exception",
-    [EXCCODE_SXD] = "128 bit vector instructions Disable exception",
-    [EXCCODE_ASXD] = "256 bit vector instructions Disable exception",
+struct TypeExcp {
+    int32_t exccode;
+    const char * const name;
+};
+
+static const struct TypeExcp excp_names[] = {
+    {EXCCODE_INT, "Interrupt"},
+    {EXCCODE_PIL, "Page invalid exception for load"},
+    {EXCCODE_PIS, "Page invalid exception for store"},
+    {EXCCODE_PIF, "Page invalid exception for fetch"},
+    {EXCCODE_PME, "Page modified exception"},
+    {EXCCODE_PNR, "Page Not Readable exception"},
+    {EXCCODE_PNX, "Page Not Executable exception"},
+    {EXCCODE_PPI, "Page Privilege error"},
+    {EXCCODE_ADEF, "Address error for instruction fetch"},
+    {EXCCODE_ADEM, "Address error for Memory access"},
+    {EXCCODE_SYS, "Syscall"},
+    {EXCCODE_BRK, "Break"},
+    {EXCCODE_INE, "Instruction Non-Existent"},
+    {EXCCODE_IPE, "Instruction privilege error"},
+    {EXCCODE_FPD, "Floating Point Disabled"},
+    {EXCCODE_FPE, "Floating Point Exception"},
+    {EXCCODE_DBP, "Debug breakpoint"},
+    {EXCCODE_BCE, "Bound Check Exception"},
+    {EXCCODE_SXD, "128 bit vector instructions Disable exception"},
+    {EXCCODE_ASXD, "256 bit vector instructions Disable exception"},
+    {EXCP_HLT, "EXCP_HLT"},
 };
 
 const char *loongarch_exception_name(int32_t exception)
 {
-    assert(excp_names[exception]);
-    return excp_names[exception];
+    int i;
+
+    for (i = 0; i < ARRAY_SIZE(excp_names); i++) {
+        if (excp_names[i].exccode == exception) {
+            return excp_names[i].name;
+        }
+    }
+    return "Unknown";
 }
 
 void G_NORETURN do_raise_exception(CPULoongArchState *env,
@@ -80,7 +92,7 @@ void G_NORETURN do_raise_exception(CPULoongArchState *env,
 {
     CPUState *cs = env_cpu(env);
 
-    qemu_log_mask(CPU_LOG_INT, "%s: %d (%s)\n",
+    qemu_log_mask(CPU_LOG_INT, "%s: expection: %d (%s)\n",
                   __func__,
                   exception,
                   loongarch_exception_name(exception));
@@ -154,22 +166,16 @@ static void loongarch_cpu_do_interrupt(CPUState *cs)
     CPULoongArchState *env = cpu_env(cs);
     bool update_badinstr = 1;
     int cause = -1;
-    const char *name;
     bool tlbfill = FIELD_EX64(env->CSR_TLBRERA, CSR_TLBRERA, ISTLBR);
     uint32_t vec_size = FIELD_EX64(env->CSR_ECFG, CSR_ECFG, VS);
 
     if (cs->exception_index != EXCCODE_INT) {
-        if (cs->exception_index < 0 ||
-            cs->exception_index >= ARRAY_SIZE(excp_names)) {
-            name = "unknown";
-        } else {
-            name = excp_names[cs->exception_index];
-        }
-
         qemu_log_mask(CPU_LOG_INT,
                      "%s enter: pc " TARGET_FMT_lx " ERA " TARGET_FMT_lx
-                     " TLBRERA " TARGET_FMT_lx " %s exception\n", __func__,
-                     env->pc, env->CSR_ERA, env->CSR_TLBRERA, name);
+                     " TLBRERA " TARGET_FMT_lx " exception: %d (%s)\n",
+                     __func__, env->pc, env->CSR_ERA, env->CSR_TLBRERA,
+                     cs->exception_index,
+                     loongarch_exception_name(cs->exception_index));
     }
 
     switch (cs->exception_index) {
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PULL 0/1] loongarch fix for 9.0
  2024-03-22 10:03 [PULL 0/1] loongarch fix for 9.0 Song Gao
  2024-03-22 10:03 ` [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' Song Gao
@ 2024-03-22 12:58 ` Peter Maydell
  1 sibling, 0 replies; 5+ messages in thread
From: Peter Maydell @ 2024-03-22 12:58 UTC (permalink / raw)
  To: Song Gao; +Cc: qemu-devel, mjt

On Fri, 22 Mar 2024 at 10:03, Song Gao <gaosong@loongson.cn> wrote:
>
> The following changes since commit fea445e8fe9acea4f775a832815ee22bdf2b0222:
>
>   Merge tag 'pull-maintainer-final-for-real-this-time-200324-1' of https://gitlab.com/stsquad/qemu into staging (2024-03-21 10:31:56 +0000)
>
> are available in the Git repository at:
>
>   https://gitlab.com/gaosong/qemu.git tags/pull-loongarch-20240322
>
> for you to fetch changes up to 1590154ee4376819a8c6ee61e849ebf4a4e7cd02:
>
>   target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' (2024-03-22 17:57:49 +0800)
>
> ----------------------------------------------------------------
> pull-loongarch-20240322
>
> ----------------------------------------------------------------


Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/9.0
for any user-visible changes.

-- PMM


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'
  2024-03-22 10:03 ` [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' Song Gao
@ 2024-03-22 14:58   ` Michael Tokarev
  2024-03-25 10:02     ` gaosong
  0 siblings, 1 reply; 5+ messages in thread
From: Michael Tokarev @ 2024-03-22 14:58 UTC (permalink / raw)
  To: Song Gao, qemu-devel; +Cc: Philippe Mathieu-Daudé

22.03.2024 13:03, Song Gao :
> qemu-system-loongarch64 assert failed with the option '-d int',
> the helper_idle() raise an exception EXCP_HLT, but the exception name is undefined.
> 
> Signed-off-by: Song Gao <gaosong@loongson.cn>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20240321123606.1704900-1-gaosong@loongson.cn>

Is this another qemu-stable material?  You Cc'd it to me but I'm not sure
what should I do with it.

For patches suitable for -stable, please Cc: qemu-stable@nongnu.org.

Thanks,

/mjt


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int'
  2024-03-22 14:58   ` Michael Tokarev
@ 2024-03-25 10:02     ` gaosong
  0 siblings, 0 replies; 5+ messages in thread
From: gaosong @ 2024-03-25 10:02 UTC (permalink / raw)
  To: Michael Tokarev, qemu-devel; +Cc: Philippe Mathieu-Daudé, qemu-stable

Cc: qemu-stable@nongnu.org

在 2024/3/22 下午10:58, Michael Tokarev 写道:
> 22.03.2024 13:03, Song Gao :
>> qemu-system-loongarch64 assert failed with the option '-d int',
>> the helper_idle() raise an exception EXCP_HLT, but the exception name 
>> is undefined.
>>
>> Signed-off-by: Song Gao <gaosong@loongson.cn>
>> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>> Message-Id: <20240321123606.1704900-1-gaosong@loongson.cn>
>
> Is this another qemu-stable material?  You Cc'd it to me but I'm not sure
> what should I do with it.
>
> For patches suitable for -stable, please Cc: qemu-stable@nongnu.org.
>
> Thanks,
>
> /mjt



^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-25 10:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-22 10:03 [PULL 0/1] loongarch fix for 9.0 Song Gao
2024-03-22 10:03 ` [PULL 1/1] target/loongarch: Fix qemu-system-loongarch64 assert failed with the option '-d int' Song Gao
2024-03-22 14:58   ` Michael Tokarev
2024-03-25 10:02     ` gaosong
2024-03-22 12:58 ` [PULL 0/1] loongarch fix for 9.0 Peter Maydell

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.