aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm
diff options
context:
space:
mode:
authorJoerg Roedel <joerg.roedel@amd.com>2009-08-07 05:49:46 -0400
committerAvi Kivity <avi@redhat.com>2009-09-10 03:46:36 -0400
commit26666957a58fab7c8a4a31f1ab24d3bbf4c58c7a (patch)
tree1bfeba7ec127deb3ae05cebd118dada7b2ef866e /arch/x86/kvm
parentcda0ffdd862d36d0b054249ce920f00d1dbae037 (diff)
KVM: SVM: move nested_svm_intr main logic out of if-clause
This patch removes one indentation level from nested_svm_intr and makes the logic more readable. Signed-off-by: Joerg Roedel <joerg.roedel@amd.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm')
-rw-r--r--arch/x86/kvm/svm.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index a1cfa7d57ab9..144f2025799f 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -1374,19 +1374,20 @@ static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr,
1374 1374
1375static inline int nested_svm_intr(struct vcpu_svm *svm) 1375static inline int nested_svm_intr(struct vcpu_svm *svm)
1376{ 1376{
1377 if (is_nested(svm)) { 1377 if (!is_nested(svm))
1378 if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK)) 1378 return 0;
1379 return 0;
1380 1379
1381 if (!(svm->vcpu.arch.hflags & HF_HIF_MASK)) 1380 if (!(svm->vcpu.arch.hflags & HF_VINTR_MASK))
1382 return 0; 1381 return 0;
1383 1382
1384 svm->vmcb->control.exit_code = SVM_EXIT_INTR; 1383 if (!(svm->vcpu.arch.hflags & HF_HIF_MASK))
1384 return 0;
1385 1385
1386 if (nested_svm_exit_handled(svm)) { 1386 svm->vmcb->control.exit_code = SVM_EXIT_INTR;
1387 nsvm_printk("VMexit -> INTR\n"); 1387
1388 return 1; 1388 if (nested_svm_exit_handled(svm)) {
1389 } 1389 nsvm_printk("VMexit -> INTR\n");
1390 return 1;
1390 } 1391 }
1391 1392
1392 return 0; 1393 return 0;