From: Richard Henderson Date: Mon, 6 Apr 2020 17:48:03 +0000 (-0700) Subject: tcg/i386: Fix %r12 guest_base initialization X-Git-Tag: v5.0.0-rc2~1^2 X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=cce743abbf398a324879039cd582349b36da0ea6;p=qemu-xen-unstable.git tcg/i386: Fix %r12 guest_base initialization When %gs cannot be used, we use register offset addressing. This path is almost never used, so it was clearly not tested. Signed-off-by: Richard Henderson Reviewed-by: Alex Bennée Tested-by: Alex Bennée Message-Id: <20200406174803.8192-1-richard.henderson@linaro.org> Signed-off-by: Alex Bennée --- diff --git a/tcg/i386/tcg-target.inc.c b/tcg/i386/tcg-target.inc.c index 7f61eeedd0..ec083bddcf 100644 --- a/tcg/i386/tcg-target.inc.c +++ b/tcg/i386/tcg-target.inc.c @@ -3737,7 +3737,7 @@ static void tcg_target_qemu_prologue(TCGContext *s) } else { /* Choose R12 because, as a base, it requires a SIB byte. */ x86_guest_base_index = TCG_REG_R12; - tcg_out_mov(s, TCG_TYPE_PTR, x86_guest_base_index, guest_base); + tcg_out_movi(s, TCG_TYPE_PTR, x86_guest_base_index, guest_base); tcg_regset_set_reg(s->reserved_regs, x86_guest_base_index); } }