Skip to content

Commit

Permalink
KVM: PPC: Exit guest context while handling exit
Browse files Browse the repository at this point in the history
The x86 implementation of KVM accounts for host time while processing
guest exits. Do the same for us.

Signed-off-by: Alexander Graf <agraf@suse.de>
  • Loading branch information
Alexander Graf committed Oct 5, 2012
1 parent c63ddcb commit 706fb73
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
2 changes: 2 additions & 0 deletions arch/powerpc/kvm/book3s_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -601,6 +601,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
__hard_irq_enable();

trace_kvm_exit(exit_nr, vcpu);
kvm_guest_exit();
preempt_enable();

switch (exit_nr) {
Expand Down Expand Up @@ -872,6 +873,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
}
}

kvm_guest_enter();
trace_kvm_book3s_reenter(r, vcpu);

return r;
Expand Down
3 changes: 3 additions & 0 deletions arch/powerpc/kvm/booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -650,6 +650,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
local_irq_enable();

trace_kvm_exit(exit_nr, vcpu);
kvm_guest_exit();

run->exit_reason = KVM_EXIT_UNKNOWN;
run->ready_for_interrupt_injection = 1;
Expand Down Expand Up @@ -952,6 +953,8 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
}
}

kvm_guest_enter();

return r;
}

Expand Down

0 comments on commit 706fb73

Please sign in to comment.