All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: Stefan Hajnoczi <stefanha@gmail.com>
Cc: kvm <kvm@vger.kernel.org>,
	Takuya Yoshikawa <yoshikawa.takuya@oss.ntt.co.jp>
Subject: Re: x86_decode_insn succeeds with GroupMask flags when it should fail
Date: Sun, 08 Jan 2012 16:51:14 +0200	[thread overview]
Message-ID: <4F09AD62.8090308@redhat.com> (raw)
In-Reply-To: <CAJSP0QVMy+0S0CYY3LVyy=EptBE+y7P=OQLvNmJh1NkCv3OvJw@mail.gmail.com>

On 01/07/2012 12:37 PM, Stefan Hajnoczi wrote:
> The unimplemented movdqa (66 0f 7f 07) instruction triggers a bug in
> the x86 emulator.  The emulator should fail since the instruction is
> unimplemented.   However the emulator thinks it is succeeding but we
> keep re-executing the same instruction over and over.  top shows 100%
> CPU utilization and perf top shows we're constantly running through
> the x86 emulator in kvm.ko.
>
> The problem is that ctxt->d != 0 even though the instruction is
> unimplemented (N):
>
> while (ctxt->d & GroupMask) {
>     switch (ctxt->d & GroupMask) {
>     ...  <-- opcode zeroed if instruction is unimplemented
>     }
>
>     ctxt->d &= ~(u64)GroupMask;  <-- only clears GroupMask
>     ctxt->d |= opcode.flags;     <-- opcode.flags == 0, ctxt->d != 0
> }
>
> ...
>
> /* Unrecognised? */
> if (ctxt->d == 0 || (ctxt->d & Undefined))  <-- always false
>     return EMULATION_FAILED;
>

#define N D(Undefined)

should fix it.

-- 
error compiling committee.c: too many arguments to function


      reply	other threads:[~2012-01-08 14:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-07 10:37 x86_decode_insn succeeds with GroupMask flags when it should fail Stefan Hajnoczi
2012-01-08 14:51 ` Avi Kivity [this message]

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=4F09AD62.8090308@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=stefanha@gmail.com \
    --cc=yoshikawa.takuya@oss.ntt.co.jp \
    /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.