All of lore.kernel.org
 help / color / mirror / Atom feed
* [PULL 0/1] loongarch bug fix for 10.1
@ 2025-08-08  1:11 Song Gao
  2025-08-08  1:11 ` [PULL 1/1] target/loongarch: Fix [X]VLDI raising exception incorrectly Song Gao
  2025-08-08 20:06 ` [PULL 0/1] loongarch bug fix for 10.1 Stefan Hajnoczi
  0 siblings, 2 replies; 3+ messages in thread
From: Song Gao @ 2025-08-08  1:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, qemu-stable

The following changes since commit cd21ee5b27b22ae66c103d36516aa5077881aa3d:

  Merge tag 'ui-pull-request' of https://gitlab.com/marcandre.lureau/qemu into staging (2025-08-07 11:02:50 -0400)

are available in the Git repository at:

  https://github.com/gaosong715/qemu.git tags/pull-loongarch-20250808

for you to fetch changes up to e66644c48e96e81848c6aa94b185f59fc212d080:

  target/loongarch: Fix [X]VLDI raising exception incorrectly (2025-08-08 09:18:44 +0800)

----------------------------------------------------------------
pul-loongarch-20250808

----------------------------------------------------------------
WANG Rui (1):
      target/loongarch: Fix [X]VLDI raising exception incorrectly

 target/loongarch/tcg/insn_trans/trans_vec.c.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)



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

* [PULL 1/1] target/loongarch: Fix [X]VLDI raising exception incorrectly
  2025-08-08  1:11 [PULL 0/1] loongarch bug fix for 10.1 Song Gao
@ 2025-08-08  1:11 ` Song Gao
  2025-08-08 20:06 ` [PULL 0/1] loongarch bug fix for 10.1 Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Song Gao @ 2025-08-08  1:11 UTC (permalink / raw)
  To: qemu-devel; +Cc: stefanha, qemu-stable, WANG Rui, Zhou Qiankang

From: WANG Rui <wangrui@loongson.cn>

According to the specification, [X]VLDI should trigger an invalid instruction
exception only when Bit[12] is 1 and Bit[11:8] > 12. This patch fixes an issue
where an exception was incorrectly raised even when Bit[12] was 0.

Test case:

```
    .global main
main:
    vldi    $vr0, 3328
    ret
```

Reported-by: Zhou Qiankang <wszqkzqk@qq.com>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
Reviewed-by: Song Gao <gaosong@loongson.cn>
Message-ID: <20250804132212.4816-1-wangrui@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
---
 target/loongarch/tcg/insn_trans/trans_vec.c.inc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/target/loongarch/tcg/insn_trans/trans_vec.c.inc b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
index 78730029cb..38bccf2838 100644
--- a/target/loongarch/tcg/insn_trans/trans_vec.c.inc
+++ b/target/loongarch/tcg/insn_trans/trans_vec.c.inc
@@ -3585,7 +3585,9 @@ static bool gen_vldi(DisasContext *ctx, arg_vldi *a, uint32_t oprsz)
     int sel, vece;
     uint64_t value;
 
-    if (!check_valid_vldi_mode(a)) {
+    sel = (a->imm >> 12) & 0x1;
+
+    if (sel && !check_valid_vldi_mode(a)) {
         generate_exception(ctx, EXCCODE_INE);
         return true;
     }
@@ -3594,8 +3596,6 @@ static bool gen_vldi(DisasContext *ctx, arg_vldi *a, uint32_t oprsz)
         return true;
     }
 
-    sel = (a->imm >> 12) & 0x1;
-
     if (sel) {
         value = vldi_get_value(ctx, a->imm);
         vece = MO_64;
-- 
2.47.0



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

* Re: [PULL 0/1] loongarch bug fix for 10.1
  2025-08-08  1:11 [PULL 0/1] loongarch bug fix for 10.1 Song Gao
  2025-08-08  1:11 ` [PULL 1/1] target/loongarch: Fix [X]VLDI raising exception incorrectly Song Gao
@ 2025-08-08 20:06 ` Stefan Hajnoczi
  1 sibling, 0 replies; 3+ messages in thread
From: Stefan Hajnoczi @ 2025-08-08 20:06 UTC (permalink / raw)
  To: Song Gao; +Cc: qemu-devel, stefanha, qemu-stable

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]

Applied, thanks.

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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

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

end of thread, other threads:[~2025-08-08 20:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-08  1:11 [PULL 0/1] loongarch bug fix for 10.1 Song Gao
2025-08-08  1:11 ` [PULL 1/1] target/loongarch: Fix [X]VLDI raising exception incorrectly Song Gao
2025-08-08 20:06 ` [PULL 0/1] loongarch bug fix for 10.1 Stefan Hajnoczi

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.