From patchwork Fri Aug 7 09:49:46 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joerg Roedel X-Patchwork-Id: 39846 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 n779tthF031466 for ; Fri, 7 Aug 2009 09:55:59 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757265AbZHGJwx (ORCPT ); Fri, 7 Aug 2009 05:52:53 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1757184AbZHGJuj (ORCPT ); Fri, 7 Aug 2009 05:50:39 -0400 Received: from va3ehsobe001.messaging.microsoft.com ([216.32.180.11]:35863 "EHLO VA3EHSOBE001.bigfish.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1755934AbZHGJuL (ORCPT ); Fri, 7 Aug 2009 05:50:11 -0400 Received: from mail51-va3-R.bigfish.com (10.7.14.254) by VA3EHSOBE001.bigfish.com (10.7.40.21) with Microsoft SMTP Server id 8.1.340.0; Fri, 7 Aug 2009 09:50:09 +0000 Received: from mail51-va3 (localhost.localdomain [127.0.0.1]) by mail51-va3-R.bigfish.com (Postfix) with ESMTP id F30F0D7821F; Fri, 7 Aug 2009 09:50:08 +0000 (UTC) X-SpamScore: 3 X-BigFish: VPS3(zzzz1202hzzz32i203h43j61h) X-Spam-TCS-SCL: 0:0 X-FB-SS: 5, Received: by mail51-va3 (MessageSwitch) id 1249638607749409_31129; Fri, 7 Aug 2009 09:50:07 +0000 (UCT) Received: from svlb1extmailp02.amd.com (unknown [139.95.251.11]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail51-va3.bigfish.com (Postfix) with ESMTP id 926D89F8050; Fri, 7 Aug 2009 09:50:07 +0000 (UTC) Received: from svlb1twp01.amd.com ([139.95.250.34]) by svlb1extmailp02.amd.com (Switch-3.2.7/Switch-3.2.7) with ESMTP id n779o1FA012657; Fri, 7 Aug 2009 02:50:04 -0700 X-WSS-ID: 0KO03BD-03-0WY-01 Received: from SSVLEXBH2.amd.com (ssvlexbh2.amd.com [139.95.53.183]) by svlb1twp01.amd.com (Tumbleweed MailGate 3.5.1) with ESMTP id 28F87884940; Fri, 7 Aug 2009 02:50:00 -0700 (PDT) Received: from SSVLEXMB1.amd.com ([139.95.53.181]) by SSVLEXBH2.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 02:50:02 -0700 Received: from SF36EXMB1.amd.com ([172.19.4.24]) by SSVLEXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 02:50:01 -0700 Received: from seurexmb1.amd.com ([165.204.9.130]) by SF36EXMB1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 11:49:54 +0200 Received: from lemmy.amd.com ([165.204.15.93]) by seurexmb1.amd.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 7 Aug 2009 11:49:51 +0200 Received: by lemmy.amd.com (Postfix, from userid 41430) id EBA32C9F6F; Fri, 7 Aug 2009 11:49:50 +0200 (CEST) From: Joerg Roedel To: Avi Kivity CC: Alexander Graf , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Joerg Roedel Subject: [PATCH 19/21] kvm/svm: move nested_svm_intr main logic out of if-clause Date: Fri, 7 Aug 2009 11:49:46 +0200 Message-ID: <1249638588-10982-20-git-send-email-joerg.roedel@amd.com> X-Mailer: git-send-email 1.6.3.3 In-Reply-To: <1249638588-10982-1-git-send-email-joerg.roedel@amd.com> References: <1249638588-10982-1-git-send-email-joerg.roedel@amd.com> X-OriginalArrivalTime: 07 Aug 2009 09:49:51.0265 (UTC) FILETIME=[688B3910:01CA1744] MIME-Version: 1.0 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This patch removes one indentation level from nested_svm_intr and makes the logic more readable. Signed-off-by: Joerg Roedel --- arch/x86/kvm/svm.c | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 9a2354d..089310d 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -1377,19 +1377,20 @@ static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr, static inline int nested_svm_intr(struct vcpu_svm *svm) { - if (is_nested(svm)) { - if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK)) - return 0; + if (!is_nested(svm)) + return 0; - if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) - return 0; + if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK)) + return 0; - svm->vmcb->control.exit_code = SVM_EXIT_INTR; + if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) + return 0; - if (nested_svm_exit_handled(svm)) { - nsvm_printk("VMexit -> INTR\n"); - return 1; - } + svm->vmcb->control.exit_code = SVM_EXIT_INTR; + + if (nested_svm_exit_handled(svm)) { + nsvm_printk("VMexit -> INTR\n"); + return 1; } return 0;