From patchwork Mon Sep 20 08:15:32 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gleb Natapov X-Patchwork-Id: 194402 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter1.kernel.org (8.14.4/8.14.3) with ESMTP id o8K8Ff8e004192 for ; Mon, 20 Sep 2010 08:15:41 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752330Ab0ITIPj (ORCPT ); Mon, 20 Sep 2010 04:15:39 -0400 Received: from mx1.redhat.com ([209.132.183.28]:33594 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751767Ab0ITIPi (ORCPT ); Mon, 20 Sep 2010 04:15:38 -0400 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o8K8FYfe030756 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Mon, 20 Sep 2010 04:15:34 -0400 Received: from dhcp-1-237.tlv.redhat.com (dhcp-1-237.tlv.redhat.com [10.35.1.237]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o8K8FXH5012887; Mon, 20 Sep 2010 04:15:33 -0400 Received: by dhcp-1-237.tlv.redhat.com (Postfix, from userid 13519) id CEC38133C0A; Mon, 20 Sep 2010 10:15:32 +0200 (IST) Date: Mon, 20 Sep 2010 10:15:32 +0200 From: Gleb Natapov To: kvm@vger.kernel.org, avi@redhat.com, mtosatti@redhat.com Cc: joerg.roedel@amd.com, agraf@suse.de Subject: [PATCHv2] SVM: do not generate "external interrupt exit" if other exit is pending Message-ID: <20100920081532.GG3008@redhat.com> MIME-Version: 1.0 Content-Disposition: inline X-Scanned-By: MIMEDefang 2.67 on 10.5.11.21 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter1.kernel.org [140.211.167.41]); Mon, 20 Sep 2010 08:15:41 +0000 (UTC) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 43f5558..ca778d5 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1707,6 +1707,14 @@ static inline bool nested_svm_intr(struct vcpu_svm *svm) if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) return false; + /* + * if vmexit was already requested (by intercepted exception + * for instance) do not overwrite it with "external interrupt" + * vmexit. + */ + if (svm->nested.exit_required) + return false; + svm->vmcb->control.exit_code = SVM_EXIT_INTR; svm->vmcb->control.exit_info_1 = 0; svm->vmcb->control.exit_info_2 = 0;