diff mbox series

[for-5.1?] target/i386: Save cc_op before loop insns

Message ID 20200720154028.477457-1-richard.henderson@linaro.org
State Superseded
Headers show
Series [for-5.1?] target/i386: Save cc_op before loop insns | expand

Commit Message

Richard Henderson July 20, 2020, 3:40 p.m. UTC
We forgot to update cc_op before these branch insns,
which lead to losing track of the current eflags.

Buglink: https://bugs.launchpad.net/qemu/+bug/1888165
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/i386/translate.c | 1 +
 1 file changed, 1 insertion(+)

-- 
2.25.1

Comments

Richard Henderson July 24, 2020, 6:34 p.m. UTC | #1
Ping?

On 7/20/20 8:40 AM, Richard Henderson wrote:
> We forgot to update cc_op before these branch insns,

> which lead to losing track of the current eflags.

> 

> Buglink: https://bugs.launchpad.net/qemu/+bug/1888165

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/i386/translate.c | 1 +

>  1 file changed, 1 insertion(+)

> 

> diff --git a/target/i386/translate.c b/target/i386/translate.c

> index a1d31f09c1..caea6f5fb1 100644

> --- a/target/i386/translate.c

> +++ b/target/i386/translate.c

> @@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)

>              l1 = gen_new_label();

>              l2 = gen_new_label();

>              l3 = gen_new_label();

> +            gen_update_cc_op(s);

>              b &= 3;

>              switch(b) {

>              case 0: /* loopnz */

>
Paolo Bonzini July 24, 2020, 6:53 p.m. UTC | #2
Looks good, will queue when I am back---or just send a pull request
yourself if you prefer.

Paolo

Il ven 24 lug 2020, 20:35 Richard Henderson <richard.henderson@linaro.org>
ha scritto:

> Ping?

>

> On 7/20/20 8:40 AM, Richard Henderson wrote:

> > We forgot to update cc_op before these branch insns,

> > which lead to losing track of the current eflags.

> >

> > Buglink: https://bugs.launchpad.net/qemu/+bug/1888165

> > Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> > ---

> >  target/i386/translate.c | 1 +

> >  1 file changed, 1 insertion(+)

> >

> > diff --git a/target/i386/translate.c b/target/i386/translate.c

> > index a1d31f09c1..caea6f5fb1 100644

> > --- a/target/i386/translate.c

> > +++ b/target/i386/translate.c

> > @@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s,

> CPUState *cpu)

> >              l1 = gen_new_label();

> >              l2 = gen_new_label();

> >              l3 = gen_new_label();

> > +            gen_update_cc_op(s);

> >              b &= 3;

> >              switch(b) {

> >              case 0: /* loopnz */

> >

>

>
<div dir="auto">Looks good, will queue when I am back---or just send a pull request yourself if you prefer.<div dir="auto"><br></div><div dir="auto">Paolo</div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">Il ven 24 lug 2020, 20:35 Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org">richard.henderson@linaro.org</a>&gt; ha scritto:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ping?<br>
<br>
On 7/20/20 8:40 AM, Richard Henderson wrote:<br>
&gt; We forgot to update cc_op before these branch insns,<br>
&gt; which lead to losing track of the current eflags.<br>
&gt; <br>
&gt; Buglink: <a href="https://bugs.launchpad.net/qemu/+bug/1888165" rel="noreferrer noreferrer" target="_blank">https://bugs.launchpad.net/qemu/+bug/1888165</a><br>
&gt; Signed-off-by: Richard Henderson &lt;<a href="mailto:richard.henderson@linaro.org" target="_blank" rel="noreferrer">richard.henderson@linaro.org</a>&gt;<br>
&gt; ---<br>
&gt;  target/i386/translate.c | 1 +<br>
&gt;  1 file changed, 1 insertion(+)<br>
&gt; <br>
&gt; diff --git a/target/i386/translate.c b/target/i386/translate.c<br>
&gt; index a1d31f09c1..caea6f5fb1 100644<br>
&gt; --- a/target/i386/translate.c<br>
&gt; +++ b/target/i386/translate.c<br>
&gt; @@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)<br>
&gt;              l1 = gen_new_label();<br>
&gt;              l2 = gen_new_label();<br>
&gt;              l3 = gen_new_label();<br>
&gt; +            gen_update_cc_op(s);<br>
&gt;              b &amp;= 3;<br>
&gt;              switch(b) {<br>
&gt;              case 0: /* loopnz */<br>
&gt; <br>
<br>
</blockquote></div>
Alex Bennée July 24, 2020, 7:23 p.m. UTC | #3
Richard Henderson <richard.henderson@linaro.org> writes:

> We forgot to update cc_op before these branch insns,

> which lead to losing track of the current eflags.

>

> Buglink: https://bugs.launchpad.net/qemu/+bug/1888165

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

> ---

>  target/i386/translate.c | 1 +

>  1 file changed, 1 insertion(+)

>

> diff --git a/target/i386/translate.c b/target/i386/translate.c

> index a1d31f09c1..caea6f5fb1 100644

> --- a/target/i386/translate.c

> +++ b/target/i386/translate.c

> @@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s,

> CPUState *cpu)


At first I thought that was too broad to go in disas_insn and then I
realised it was one of those mega functions....

>              l1 = gen_new_label();

>              l2 = gen_new_label();

>              l3 = gen_new_label();

> +            gen_update_cc_op(s);



Seems legit:

Reviewed-by: Alex Bennée <alex.bennee@linaro.org>

<snip>

-- 
Alex Bennée
Richard Henderson July 24, 2020, 9:47 p.m. UTC | #4
On 7/24/20 11:53 AM, Paolo Bonzini wrote:
> Looks good, will queue when I am back---or just send a pull request yourself if

> you prefer.


Ok, will do.  Thanks.


r~

> 

> Paolo

> 

> Il ven 24 lug 2020, 20:35 Richard Henderson <richard.henderson@linaro.org

> <mailto:richard.henderson@linaro.org>> ha scritto:

> 

>     Ping?

> 

>     On 7/20/20 8:40 AM, Richard Henderson wrote:

>     > We forgot to update cc_op before these branch insns,

>     > which lead to losing track of the current eflags.

>     >

>     > Buglink: https://bugs.launchpad.net/qemu/+bug/1888165

>     > Signed-off-by: Richard Henderson <richard.henderson@linaro.org

>     <mailto:richard.henderson@linaro.org>>

>     > ---

>     >  target/i386/translate.c | 1 +

>     >  1 file changed, 1 insertion(+)

>     >

>     > diff --git a/target/i386/translate.c b/target/i386/translate.c

>     > index a1d31f09c1..caea6f5fb1 100644

>     > --- a/target/i386/translate.c

>     > +++ b/target/i386/translate.c

>     > @@ -7148,6 +7148,7 @@ static target_ulong disas_insn(DisasContext *s,

>     CPUState *cpu)

>     >              l1 = gen_new_label();

>     >              l2 = gen_new_label();

>     >              l3 = gen_new_label();

>     > +            gen_update_cc_op(s);

>     >              b &= 3;

>     >              switch(b) {

>     >              case 0: /* loopnz */

>     >

>
diff mbox series

Patch

diff --git a/target/i386/translate.c b/target/i386/translate.c
index a1d31f09c1..caea6f5fb1 100644
--- a/target/i386/translate.c
+++ b/target/i386/translate.c
@@ -7148,6 +7148,7 @@  static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
             l1 = gen_new_label();
             l2 = gen_new_label();
             l3 = gen_new_label();
+            gen_update_cc_op(s);
             b &= 3;
             switch(b) {
             case 0: /* loopnz */