From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: KVM internal error. Suberror: 1, emulation failure Date: Thu, 18 Jul 2013 09:52:10 +0300 Message-ID: <20130718065210.GA16660@redhat.com> References: <51E6C361.7030908@sr71.net> <51E78407.80109@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Dave Hansen , kvm@vger.kernel.org To: Paolo Bonzini Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14776 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758520Ab3GRGwR (ORCPT ); Thu, 18 Jul 2013 02:52:17 -0400 Content-Disposition: inline In-Reply-To: <51E78407.80109@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: 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.