All of lore.kernel.org
 help / color / mirror / Atom feed
From: malc <av1474@comtv.ru>
To: qemu-devel@nongnu.org
Cc: Richard Henderson <rth@twiddle.net>
Subject: [Qemu-devel] TCG sar UB
Date: Mon, 22 Aug 2011 14:47:09 +0400 (MSD)	[thread overview]
Message-ID: <alpine.LNX.2.00.1108221441400.4946@linmac> (raw)

While booting linux-test 0.2 following sequence of instructions is seen:

IN: 
0xc03227aa:  mov    %esi,%edx
0xc03227ac:  xor    %ecx,%ecx
0xc03227ae:  movzwl 0x12(%esp),%ebp
0xc03227b3:  mov    %edi,%eax
0xc03227b5:  sar    %cl,%eax
0xc03227b7:  and    $0x1,%eax
0xc03227ba:  je     0xc0322802

OP after liveness analysis:
 mov_i32 tmp0,esi
 mov_i32 edx,tmp0
 nopn $0x2,$0x2
 movi_i32 ecx,$0x0
 discard cc_src
 movi_i32 cc_dst,$0x0
 mov_i32 tmp2,esp
 movi_i32 tmp13,$0x12
 add_i32 tmp2,tmp2,tmp13
 qemu_ld16u tmp0,tmp2,$0x0
 mov_i32 ebp,tmp0
 mov_i32 tmp0,edi
 mov_i32 eax,tmp0
 nopn $0x2,$0x2
 mov_i32 tmp0,eax
 nopn $0x2,$0x2
 movi_i32 tmp1,$0x0
 nopn $0x2,$0x2
 movi_i32 tmp10,$0xffffffff
 sar_i32 tmp3,tmp0,tmp10

Doesn't make much sense to me, guest clearly asked for 0 and not -1,
besides -1 violates TCG's sar constraints and PPC obliges by emiting
illegal instruction in this case.

-- 
mailto:av1474@comtv.ru

                 reply	other threads:[~2011-08-22 10:47 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=alpine.LNX.2.00.1108221441400.4946@linmac \
    --to=av1474@comtv.ru \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.