Skip to content

Commit

Permalink
KVM: SVM: move nested_svm_intr main logic out of if-clause
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Joerg Roedel authored and Avi Kivity committed Sep 10, 2009
1 parent cda0ffd commit 2666695
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions arch/x86/kvm/svm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1374,19 +1374,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;
Expand Down

0 comments on commit 2666695

Please sign in to comment.