From patchwork Wed Nov 4 10:47:24 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Avi Kivity X-Patchwork-Id: 57507 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nA4AlXcm030861 for ; Wed, 4 Nov 2009 10:47:34 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755083AbZKDKrX (ORCPT ); Wed, 4 Nov 2009 05:47:23 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1755256AbZKDKrX (ORCPT ); Wed, 4 Nov 2009 05:47:23 -0500 Received: from mx1.redhat.com ([209.132.183.28]:23331 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755073AbZKDKrV (ORCPT ); Wed, 4 Nov 2009 05:47:21 -0500 Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id nA4AlRlC022841 for ; Wed, 4 Nov 2009 05:47:27 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id nA4AlPTL030513; Wed, 4 Nov 2009 05:47:26 -0500 Received: from localhost.localdomain (file.tlv.redhat.com [10.35.255.8]) by cleopatra.tlv.redhat.com (Postfix) with ESMTP id E1E0925004E; Wed, 4 Nov 2009 12:47:24 +0200 (IST) From: Avi Kivity To: Marcelo Tosatti Cc: kvm@vger.kernel.org, Gleb Natapov Subject: [PATCH 2/2] KVM: VMX: Report unexpected simultaneous exceptions as internal errors Date: Wed, 4 Nov 2009 12:47:24 +0200 Message-Id: <1257331644-29642-3-git-send-email-avi@redhat.com> In-Reply-To: <1257331644-29642-1-git-send-email-avi@redhat.com> References: <1257331644-29642-1-git-send-email-avi@redhat.com> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c index 85a7363..8b8eaac 100644 --- a/arch/x86/kvm/vmx.c +++ b/arch/x86/kvm/vmx.c @@ -2738,9 +2738,14 @@ static int handle_exception(struct kvm_vcpu *vcpu) return handle_machine_check(vcpu); if ((vect_info & VECTORING_INFO_VALID_MASK) && - !is_page_fault(intr_info)) - printk(KERN_ERR "%s: unexpected, vectoring info 0x%x " - "intr info 0x%x\n", __func__, vect_info, intr_info); + !is_page_fault(intr_info)) { + vcpu->run->exit_reason = KVM_EXIT_INTERNAL_ERROR; + vcpu->run->internal.suberror = KVM_INTERNAL_ERROR_SIMUL_EX; + vcpu->run->internal.ndata = 2; + vcpu->run->internal.data[0] = vect_info; + vcpu->run->internal.data[1] = intr_info; + return 0; + } if ((intr_info & INTR_INFO_INTR_TYPE_MASK) == INTR_TYPE_NMI_INTR) return 1; /* already handled by vmx_vcpu_run() */ diff --git a/include/linux/kvm.h b/include/linux/kvm.h index 6d27513..089cad7 100644 --- a/include/linux/kvm.h +++ b/include/linux/kvm.h @@ -99,6 +99,7 @@ struct kvm_pit_config { /* For KVM_EXIT_INTERNAL_ERROR */ #define KVM_INTERNAL_ERROR_EMULATION 1 +#define KVM_INTERNAL_ERROR_SIMUL_EX 2 /* for KVM_RUN, returned by mmap(vcpu_fd, offset=0) */ struct kvm_run {