Skip to contentSkip to conversation

Miscellaneous fixes for QEMU 9.1-rc

GIT PULL Applied Paolo Bonzini 2 participants 8 messages Aug 13, 2024 – Aug 14, 2024 Arm/Amlogic Meson SoC support

lore
Share & tools
lore
#0 lore raw

The following changes since commit 9eb51530c12ae645b91e308d16196c68563ea883:

Merge tag 'block-pull-request' of https://gitlab.com/stefanha/qemu into staging (2024-08-13 07:59:32 +1000)

are available in the Git repository at:

https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 3ef11c991e501768f2fa646e8438f075be1cd2f5:

po: update Italian translation (2024-08-13 19:01:42 +0200)

----------------------------------------------------------------
* fix --static compilation of hexagon
* fix incorrect application of REX to MMX operands
* fix crash on module load
* update Italian translation

----------------------------------------------------------------
Alexander Ivanov (1):
module: Prevent crash by resetting local_err in module_load_qom_all()

Alyssa Ross (1):
target/hexagon: don't look for static glib

Paolo Bonzini (1):
po: update Italian translation

Richard Henderson (3):
target/i386: Do not apply REX to MMX operands target/i386: Use unit not type in decode_modrm target/i386: Assert MMX and XMM registers in range

 util/module.c                    |  2 +-
 target/i386/tcg/decode-new.c.inc | 13 ++++++++-----
 target/i386/tcg/emit.c.inc       |  9 +++++++--
 po/it.po                         |  2 +-
 target/hexagon/meson.build       |  2 +-
 5 files changed, 18 insertions(+), 10 deletions(-)
Signature · 1 line
2.46.0
#1 lore raw

[PULL 1/6] target/hexagon: don't look for static glib

From: Alyssa Ross <[email protected]>

When cross compiling QEMU configured with --static, I've been getting configure errors like the following:

Build-time dependency glib-2.0 found: NO

../target/hexagon/meson.build:303:15: ERROR: Dependency lookup for glib-2.0 with method 'pkgconfig' failed: Could not generate libs for glib-2.0:
Package libpcre2-8 was not found in the pkg-config search path.
Perhaps you should add the directory containing `libpcre2-8.pc'
to the PKG_CONFIG_PATH environment variable
Package 'libpcre2-8', required by 'glib-2.0', not found

This happens because --static sets the prefer_static Meson option, but my build machine doesn't have a static libpcre2. I don't think it makes sense to insist that native dependencies are static, just because I want the non-native QEMU binaries to be static.

---
 target/hexagon/meson.build | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
target/hexagon/meson.build +1 -1
index b0b253aa6bf..9ea1f4fc594 100644
@@ -300,7 +300,7 @@ if idef_parser_enabled and 'hexagon-linux-user' in target_dirs
         arguments: ['@INPUT@', '--defines=@OUTPUT1@', '--output=@OUTPUT0@']
     )
 
-    glib_dep = dependency('glib-2.0', native: true)
+    glib_dep = dependency('glib-2.0', native: true, static: false)
 
     idef_parser = executable(
         'idef-parser',
Signature · 1 line
2.46.0
#2 lore raw

[PULL 3/6] target/i386: Use unit not type in decode_modrm

In reply to Paolo Bonzini

From: Richard Henderson <[email protected]>

Rather that enumerating the types that can produce MMX operands, examine the unit. No functional change.

---
 target/i386/tcg/decode-new.c.inc | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
target/i386/tcg/decode-new.c.inc +4 -4
index 03138b3876d..30be9237c31 100644
@@ -1799,13 +1799,13 @@ static void decode_root(DisasContext *s, CPUX86State *env, X86OpEntry *entry, ui
 }
 
 
-static int decode_modrm(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
-                        X86DecodedOp *op, X86OpType type)
+static int decode_modrm(DisasContext *s, CPUX86State *env,
+                        X86DecodedInsn *decode, X86DecodedOp *op)
 {
     int modrm = get_modrm(s, env);
     if ((modrm >> 6) == 3) {
         op->n = (modrm & 7);
-        if (type != X86_TYPE_Q && type != X86_TYPE_N) {
+        if (op->unit != X86_OP_MMX) {
             op->n |= REX_B(s);
         }
     } else {
@@ -2040,7 +2040,7 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
         /* fall through */
     case X86_TYPE_nop:  /* modrm operand decoded but not fetched */
     get_modrm:
-        decode_modrm(s, env, decode, op, type);
+        decode_modrm(s, env, decode, op);
         break;
 
     case X86_TYPE_O:  /* Absolute address encoded in the instruction */
Signature · 1 line
2.46.0
#3 lore raw

[PULL 5/6] module: Prevent crash by resetting local_err in module_load_qom_all()

In reply to Paolo Bonzini

From: Alexander Ivanov <[email protected]>

Set local_err to NULL after it has been freed in error_report_err(). This avoids triggering assert(*errp == NULL) failure in error_setv() when local_err is reused in the loop.

---
 util/module.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
util/module.c +1 -1
index 32e263163c7..3eb0f06df16 100644
@@ -354,13 +354,13 @@ int module_load_qom(const char *type, Error **errp)
 void module_load_qom_all(void)
 {
     const QemuModinfo *modinfo;
-    Error *local_err = NULL;
 
     if (module_loaded_qom_all) {
         return;
     }
 
     for (modinfo = module_info; modinfo->name != NULL; modinfo++) {
+        Error *local_err = NULL;
         if (!modinfo->objs) {
             continue;
         }
Signature · 1 line
2.46.0
#4 lore raw

[PULL 6/6] po: update Italian translation

In reply to Paolo Bonzini

Reported-by: bovirus <https://gitlab.com/bovirus>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2451

---
 po/it.po | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
po/it.po +1 -1
index c6d95172070..363b9bddf2f 100644
@@ -65,7 +65,7 @@ msgid "Detach Tab"
 msgstr "_Sposta in una nuova finestra"
 
 msgid "Show Menubar"
-msgstr ""
+msgstr "Mostra _barra dei menu"
 
 msgid "_Machine"
 msgstr "_Macchina virtuale"
Signature · 1 line
2.46.0
#5 lore raw

[PULL 2/6] target/i386: Do not apply REX to MMX operands

In reply to Paolo Bonzini

From: Richard Henderson <[email protected]>

Fixes b3e22b2318a ("target/i386: add core of new i386 decoder")

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2495

---
 target/i386/tcg/decode-new.c.inc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
target/i386/tcg/decode-new.c.inc +4 -1
index b22210f45d9..03138b3876d 100644
@@ -1979,7 +1979,10 @@ static bool decode_op(DisasContext *s, CPUX86State *env, X86DecodedInsn *decode,
             op->unit = X86_OP_SSE;
         }
     get_reg:
-        op->n = ((get_modrm(s, env) >> 3) & 7) | REX_R(s);
+        op->n = ((get_modrm(s, env) >> 3) & 7);
+        if (op->unit != X86_OP_MMX) {
+            op->n |= REX_R(s);
+        }
         break;
 
     case X86_TYPE_E:  /* ALU modrm operand */
Signature · 1 line
2.46.0
#6 lore raw

[PULL 4/6] target/i386: Assert MMX and XMM registers in range

In reply to Paolo Bonzini

From: Richard Henderson <[email protected]>

The mmx assert would fire without the fix for #2495.

---
 target/i386/tcg/emit.c.inc | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)
target/i386/tcg/emit.c.inc +7 -2
index 016dce81464..22a06897fb7 100644
@@ -33,8 +33,13 @@
 #define TCG_TARGET_extract_tl_valid     TCG_TARGET_extract_i32_valid
 #endif
 
+#define MMX_OFFSET(reg)                        \
+  ({ assert((reg) >= 0 && (reg) <= 7);         \
+     offsetof(CPUX86State, fpregs[reg].mmx); })
 
-#define ZMM_OFFSET(reg) offsetof(CPUX86State, xmm_regs[reg])
+#define ZMM_OFFSET(reg)                        \
+  ({ assert((reg) >= 0 && (reg) <= 15);        \
+     offsetof(CPUX86State, xmm_regs[reg]); })
 
 typedef void (*SSEFunc_i_ep)(TCGv_i32 val, TCGv_ptr env, TCGv_ptr reg);
 typedef void (*SSEFunc_l_ep)(TCGv_i64 val, TCGv_ptr env, TCGv_ptr reg);
@@ -168,7 +173,7 @@ static int vector_elem_offset(X86DecodedOp *op, MemOp ot, int n)
 static void compute_mmx_offset(X86DecodedOp *op)
 {
     if (!op->has_ea) {
-        op->offset = offsetof(CPUX86State, fpregs[op->n].mmx) + mmx_offset(op->ot);
+        op->offset = MMX_OFFSET(op->n) + mmx_offset(op->ot);
     } else {
         op->offset = offsetof(CPUX86State, mmx_t0) + mmx_offset(op->ot);
     }
Signature · 1 line
2.46.0
#7 lore raw
In reply to Paolo Bonzini
Quoted 10 lines · Paolo Bonzini

The following changes since commit 9eb51530c12ae645b91e308d16196c68563ea883:

   Merge tag 'block-pull-request' ofhttps://gitlab.com/stefanha/qemu into staging (2024-08-13 07:59:32 +1000)

are available in the Git repository at:

https://gitlab.com/bonzini/qemu.git tags/for-upstream

for you to fetch changes up to 3ef11c991e501768f2fa646e8438f075be1cd2f5:

Quoted 7 lines
   po: update Italian translation (2024-08-13 19:01:42 +0200)

----------------------------------------------------------------
* fix --static compilation of hexagon
* fix incorrect application of REX to MMX operands
* fix crash on module load
* update Italian translation

Applied, thanks. Please update https://wiki.qemu.org/ChangeLog/9.1 as appropriate.

r~