qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Richard Henderson <richard.henderson@linaro.org>
To: Sven Schnelle <svens@stackframe.org>, qemu-devel@nongnu.org
Cc: deller@gmx.de, Richard Henderson <rth@twiddle.net>
Subject: Re: [Qemu-devel] [PATCH 3/5] target/hppa: fix log conditions
Date: Mon, 11 Feb 2019 20:30:11 -0800	[thread overview]
Message-ID: <c43bc5ed-9107-9c1e-993e-0bebb5a39826@linaro.org> (raw)
In-Reply-To: <20190211181907.2219-4-svens@stackframe.org>

On 2/11/19 10:19 AM, Sven Schnelle wrote:
>      switch (cf >> 1) {
> -    case 4: case 5: case 6:
> -        cf &= 1;
> +    case 0: /* never */
> +        cond = cond_make_f();
> +        break;
> +    case 1: /* = all bits are zero */
> +        cond = cond_make_0(TCG_COND_EQ, res);
> +        break;
> +    case 2: /* < leftmost bit is 1 */
> +        cond = cond_make_0(TCG_COND_LT, res);
> +        break;
> +    case 3: /* <= leftmost bit is 1 or all bits 0 */
> +        cond = cond_make_0(TCG_COND_LE, res);
> +        break;
> +    case 7: /* OD rightmost bit is 1 */
> +        tmp = tcg_temp_new();
> +        tcg_gen_andi_reg(tmp, res, 1);
> +        cond = cond_make_0(TCG_COND_NE, tmp);
> +        tcg_temp_free(tmp);
> +        break;
> +    default:
>          break;
>      }

You can't do nothing for cases 4,5,6.  That lets a bad guest crash qemu, since
cond will be uninitialized.  Also, this patch has to be sorted before the
previous, as otherwise you introduce a regression during bisection.

I've fixed this up locally.


r~

  reply	other threads:[~2019-02-12  4:30 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-11 18:19 [Qemu-devel] [PATCH 1/5] target/hppa: move GETPC to HELPER() functions Sven Schnelle
2019-02-11 18:19 ` [Qemu-devel] [PATCH 2/5] target/hppa: fix '</<=' conditions Sven Schnelle
2019-02-12  4:26   ` Richard Henderson
2019-02-11 18:19 ` [Qemu-devel] [PATCH 3/5] target/hppa: fix log conditions Sven Schnelle
2019-02-12  4:30   ` Richard Henderson [this message]
2019-02-11 18:19 ` [Qemu-devel] [PATCH 4/5] target/hppa: fix sed conditions Sven Schnelle
2019-02-12  4:27   ` Richard Henderson
2019-02-14  8:10     ` Sven Schnelle
2019-02-11 18:19 ` [Qemu-devel] [PATCH 5/5] target/hppa: fix dcor instruction Sven Schnelle
2019-02-12  4:30   ` Richard Henderson
2019-02-12  0:07 ` [Qemu-devel] [PATCH 1/5] target/hppa: move GETPC to HELPER() functions Richard Henderson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=c43bc5ed-9107-9c1e-993e-0bebb5a39826@linaro.org \
    --to=richard.henderson@linaro.org \
    --cc=deller@gmx.de \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=svens@stackframe.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).