From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] VMX: Invalid guest state detection enhancements and bug fixes Date: Tue, 11 May 2010 14:06:09 +0300 Message-ID: <20100511110609.GI2504@redhat.com> References: <1273506685-2153-1-git-send-email-m.gamal005@gmail.com> <4BE9224E.5090305@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=koi8-r Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: Avi Kivity , mtosatti@redhat.com, kvm@vger.kernel.org To: Mohammed Gamal Return-path: Received: from mx1.redhat.com ([209.132.183.28]:65519 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750953Ab0EKLGL convert rfc822-to-8bit (ORCPT ); Tue, 11 May 2010 07:06:11 -0400 Content-Disposition: inline In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: On Tue, May 11, 2010 at 01:53:51PM +0300, Mohammed Gamal wrote: > >> =9A =9A =9A =9A =9A =9A =9A =9Aif (err !=3D EMULATE_DONE) { > >> + =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A kvm_report_emulation= _failure(vcpu, "invalid guest > >> state handler"); > >> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Avcpu->run->exit_rea= son =3D KVM_EXIT_INTERNAL_ERROR; > >> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Avcpu->run->internal= =2Esuberror =3D > >> KVM_INTERNAL_ERROR_EMULATION; > >> =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9A =9Avcpu->run->internal= =2Endata =3D 0; > >> > > > > Uneeded, userspace can report it. >=20 > Userspace does report the address at which a VM fails, it doesn't for > instance show the contents of RIP which is necessary for knowing whic= h > instruction failed, this is at least needed for testing purposes. IIR= C > I've seen some trace_kvm_failed_insn() functions somewhere. But I > don't know how to use tracing utilities so I'd be delighted if someon= e > could point me to some relevant documentation or something. Userspace can be extended to print instruction at RIP on emulation failure. Furthermore userspace can even disassemble it for you. IIRC kvm_report_emulation_failure() was once removed from here and I've actually sent patch to remove kvm_report_emulation_failure() at all. -- Gleb.