From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH] KVM: Add missing emulation failure report in kvm_mmu_page_fault() Date: Mon, 18 Jan 2010 17:32:25 +0800 Message-ID: <201001181732.25678.sheng@linux.intel.com> References: <1263545063-10285-1-git-send-email-sheng@linux.intel.com> <4B5303CF.2070508@redhat.com> Mime-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from mga09.intel.com ([134.134.136.24]:62465 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753363Ab0ARJcp (ORCPT ); Mon, 18 Jan 2010 04:32:45 -0500 In-Reply-To: <4B5303CF.2070508@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Sunday 17 January 2010 20:34:23 Avi Kivity wrote: > On 01/15/2010 10:44 AM, Sheng Yang wrote: > > Currently we only have handle_invalid_guest_state() reported emulation > > failure... > > > > Signed-off-by: Sheng Yang > > --- > > arch/x86/kvm/mmu.c | 1 + > > 1 files changed, 1 insertions(+), 0 deletions(-) > > > > diff --git a/arch/x86/kvm/mmu.c b/arch/x86/kvm/mmu.c > > index 4f5508c..037e52a 100644 > > --- a/arch/x86/kvm/mmu.c > > +++ b/arch/x86/kvm/mmu.c > > @@ -2791,6 +2791,7 @@ int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t > > cr2, u32 error_code) ++vcpu->stat.mmio_exits; > > return 0; > > case EMULATE_FAIL: > > + kvm_report_emulation_failure(vcpu, "emulation failure"); > > vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; > > vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_EMULATION; > > vcpu->run->internal.ndata = 0; > > This is intentional - instead of spamming dmesg, we exit with an > internal error. Modern qemu-kvm will halt and allow the user to inspect > the guest with the built-in disassembler. > I think keep it there still useful for some users. And we have the same report in handle_invalid_guest_state(), and we even have "emulation failure, check dmesg for details" in QEmu when handling KVM_INTERNAL_ERROR_EMULATION. I think add one line here is the easiest way to keep consistence, and is handy. -- regards Yang, Sheng