All of lore.kernel.org
 help / color / mirror / Atom feed
From: Gleb Natapov <gleb@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: Dave Hansen <dave@sr71.net>, kvm@vger.kernel.org
Subject: Re: KVM internal error. Suberror: 1, emulation failure
Date: Thu, 18 Jul 2013 09:52:10 +0300	[thread overview]
Message-ID: <20130718065210.GA16660@redhat.com> (raw)
In-Reply-To: <51E78407.80109@redhat.com>

On Thu, Jul 18, 2013 at 07:58:31AM +0200, Paolo Bonzini wrote:
> Il 17/07/2013 18:16, Dave Hansen ha scritto:
> > I'm causing qemu to spew these emulation failure messages until I kill
> > it.  The guest kernel being run has been hacked up pretty heavily and is
> > probably either accessing bad physical addresses (above the address
> > ranges in the e820 table) or trying to DMA to bad addresses.
> > 
> > What I'd really like qemu to be doing is trapping back in to the guest
> > kernel to have it handle this issue.  Then I'd have a better chance of
> > dumping out some debugging information to see where I went wrong.
> 
> This is happening because the kernel is executing a PCMPEQB instruction
> on an invalid memory address.  This instruction is not yet emulated by
> KVM.  If you want QEMU to trap back to the guest kernel, you can add
> emulation of the instruction to arch/x86/kvm/emulate.c.
> 
> If you do not really care about the guest doing something sane, you can
> use a stub emulation function that is just "return emulate_ud(ctxt)".
> That alone could be a good starting point to attach a kernel debugger to
> the guest.
> 
This is the behaviour that he currently gets (assuming there is no bug
somewhere, run ftrace to check), see my other reply. Not sure what he does
in his #UD handler that emulation error reappear. Restart offending process?

--
			Gleb.

      reply	other threads:[~2013-07-18  6:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-17 16:16 KVM internal error. Suberror: 1, emulation failure Dave Hansen
2013-07-18  5:53 ` Gleb Natapov
2013-07-18  5:58 ` Paolo Bonzini
2013-07-18  6:52   ` Gleb Natapov [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=20130718065210.GA16660@redhat.com \
    --to=gleb@redhat.com \
    --cc=dave@sr71.net \
    --cc=kvm@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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.