提交 8b33e82b 编写于 作者: P Paolo Bonzini 提交者: Richard Henderson

target-i386: Avoid repeated calls to the bnd_jmp helper

Two flags were tested the wrong way.
Tested-by: NHervé Poussineau <hpoussin@reactos.org>
Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
Message-Id: <1456845145-18891-1-git-send-email-pbonzini@redhat.com>
Signed-off-by: NRichard Henderson <rth@twiddle.net>
[rth: Fixed enable test as well.]
上级 618a5a8b
...@@ -2409,12 +2409,12 @@ static void gen_reset_hflag(DisasContext *s, uint32_t mask) ...@@ -2409,12 +2409,12 @@ static void gen_reset_hflag(DisasContext *s, uint32_t mask)
/* Clear BND registers during legacy branches. */ /* Clear BND registers during legacy branches. */
static void gen_bnd_jmp(DisasContext *s) static void gen_bnd_jmp(DisasContext *s)
{ {
/* Do nothing if BND prefix present, MPX is disabled, or if the /* Clear the registers only if BND prefix is missing, MPX is enabled,
BNDREGs are known to be in INIT state already. The helper and if the BNDREGs are known to be in use (non-zero) already.
itself will check BNDPRESERVE at runtime. */ The helper itself will check BNDPRESERVE at runtime. */
if ((s->prefix & PREFIX_REPNZ) == 0 if ((s->prefix & PREFIX_REPNZ) == 0
&& (s->flags & HF_MPX_EN_MASK) == 0 && (s->flags & HF_MPX_EN_MASK) != 0
&& (s->flags & HF_MPX_IU_MASK) == 0) { && (s->flags & HF_MPX_IU_MASK) != 0) {
gen_helper_bnd_jmp(cpu_env); gen_helper_bnd_jmp(cpu_env);
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册