Skip to contentSkip to conversation

tcg fixes

GIT PULL Applied Richard Henderson 2 participants 4 messages Jul 27, 2015

lore
Share & tools
lore
#0 lore raw

Two buglets that Aurelien has found in the last week. We don't have test cases that fail without additional patches, but better to fix them anyway.

r~

The following changes since commit e40db4c6d391419c0039fe274c74df32a6ca1a28:

Merge remote-tracking branch 'remotes/jnsnow/tags/cve-2015-5154-pull-request' into staging (2015-07-27 13:10:00 +0100)

are available in the git repository at:

git://github.com/rth7680/qemu.git tags/pull-tcg-20150727

for you to fetch changes up to bbeb82395eaca0e3c38b433b2d2a5bad4a5fbd81:

tcg: mark temps as mem_coherent = 0 for mov with a constant (2015-07-27 07:25:40 -0700)

----------------------------------------------------------------
Fix buglets for 2.4

----------------------------------------------------------------
Aurelien Jarno (2):
tcg: correctly mark dead inputs for mov with a constant
tcg: mark temps as mem_coherent = 0 for mov with a constant

 tcg/tcg.c | 4 ++++
 1 file changed, 4 insertions(+)
#1 lore raw

[Qemu-devel] [PULL for-2.4 2/2] tcg: mark temps as mem_coherent = 0 for mov with a constant

From: Aurelien Jarno <[email protected]>

When a constant has to be loaded in a mov op, we fail to set mem_coherent = 0. This patch fixes that.

Cc Richard Henderson <[email protected]>

Message-Id: <[email protected]>

---
 tcg/tcg.c | 1 +
 1 file changed, 1 insertion(+)
tcg/tcg.c +1 -0
index 9a2508b..0892a9b 100644
@@ -1894,6 +1894,7 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def,
             ts->mem_coherent = 1;
         } else if (ts->val_type == TEMP_VAL_CONST) {
             tcg_out_movi(s, itype, ts->reg, ts->val);
+            ts->mem_coherent = 0;
         }
         s->reg_to_temp[ts->reg] = args[1];
         ts->val_type = TEMP_VAL_REG;
Signature · 1 line
2.4.3
#2 lore raw

[Qemu-devel] [PULL for-2.4 1/2] tcg: correctly mark dead inputs for mov with a constant

In reply to Richard Henderson

From: Aurelien Jarno <[email protected]>

When tcg_reg_alloc_mov propagate a constant, we failed to correctly mark a temp as dead if the liveness analysis hints so. This fixes the following assert when configure with --enable-debug-tcg:

qemu-x86_64: tcg/tcg.c:1827: tcg_reg_alloc_bb_end: Assertion `ts->val_type == TEMP_VAL_DEAD' failed.

Message-Id: <[email protected]>

---
 tcg/tcg.c | 3 +++
 1 file changed, 3 insertions(+)
tcg/tcg.c +3 -0
index 7e088b1..9a2508b 100644
@@ -1920,6 +1920,9 @@ static void tcg_reg_alloc_mov(TCGContext *s, const TCGOpDef *def,
         }
         ots->val_type = TEMP_VAL_CONST;
         ots->val = ts->val;
+        if (IS_DEAD_ARG(1)) {
+            temp_dead(s, args[1]);
+        }
     } else {
         /* The code in the first if block should have moved the
            temp to a register. */
Signature · 1 line
2.4.3
#3 lore raw
In reply to Richard Henderson
Quoted 20 lines · Richard Henderson

Two buglets that Aurelien has found in the last week. We don't have test cases that fail without additional patches, but better to fix them anyway.

r~

The following changes since commit e40db4c6d391419c0039fe274c74df32a6ca1a28:

Merge remote-tracking branch 'remotes/jnsnow/tags/cve-2015-5154-pull-request' into staging (2015-07-27 13:10:00 +0100)

are available in the git repository at:

git://github.com/rth7680/qemu.git tags/pull-tcg-20150727

for you to fetch changes up to bbeb82395eaca0e3c38b433b2d2a5bad4a5fbd81:

tcg: mark temps as mem_coherent = 0 for mov with a constant (2015-07-27 07:25:40 -0700)

Quoted 7 lines

----------------------------------------------------------------
Fix buglets for 2.4

----------------------------------------------------------------
Aurelien Jarno (2):
tcg: correctly mark dead inputs for mov with a constant
tcg: mark temps as mem_coherent = 0 for mov with a constant

Applied, thanks.

-- PMM