Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343471
b: refs/heads/master
c: 7ee7885
h: refs/heads/master
i:
  343469: fd044fd
  343467: 106e374
  343463: 749a968
  343455: f68960b
v: v3
  • Loading branch information
Alexander Graf committed Oct 5, 2012
1 parent 0b5b3ae commit 31f9aaf
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 206c2ed7f1ea55222bde2954ee3d65c2e9cfb750
refs/heads/master: 7ee788556bf395a8ef413bea33494df29a3409e0
12 changes: 6 additions & 6 deletions trunk/arch/powerpc/kvm/book3s_pr.c
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
unsigned int exit_nr)
{
int r = RESUME_HOST;
int s;

vcpu->stat.sum_exits++;

Expand Down Expand Up @@ -862,10 +863,10 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
* again due to a host external interrupt.
*/
local_irq_disable();
if (kvmppc_prepare_to_enter(vcpu)) {
s = kvmppc_prepare_to_enter(vcpu);
if (s <= 0) {
local_irq_enable();
run->exit_reason = KVM_EXIT_INTR;
r = -EINTR;
r = s;
} else {
kvmppc_lazy_ee_enable();
}
Expand Down Expand Up @@ -1074,10 +1075,9 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
* a host external interrupt.
*/
local_irq_disable();
if (kvmppc_prepare_to_enter(vcpu)) {
ret = kvmppc_prepare_to_enter(vcpu);
if (ret <= 0) {
local_irq_enable();
kvm_run->exit_reason = KVM_EXIT_INTR;
ret = -EINTR;
goto out;
}

Expand Down
16 changes: 8 additions & 8 deletions trunk/arch/powerpc/kvm/booke.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ void kvmppc_core_check_requests(struct kvm_vcpu *vcpu)

int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
{
int ret;
int ret, s;
#ifdef CONFIG_PPC_FPU
unsigned int fpscr;
int fpexc_mode;
Expand All @@ -480,10 +480,10 @@ int kvmppc_vcpu_run(struct kvm_run *kvm_run, struct kvm_vcpu *vcpu)
}

local_irq_disable();
if (kvmppc_prepare_to_enter(vcpu)) {
s = kvmppc_prepare_to_enter(vcpu);
if (s <= 0) {
local_irq_enable();
kvm_run->exit_reason = KVM_EXIT_INTR;
ret = -EINTR;
ret = s;
goto out;
}
kvmppc_lazy_ee_enable();
Expand Down Expand Up @@ -642,6 +642,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
unsigned int exit_nr)
{
int r = RESUME_HOST;
int s;

/* update before a new last_exit_type is rewritten */
kvmppc_update_timing_stats(vcpu);
Expand Down Expand Up @@ -948,11 +949,10 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
*/
if (!(r & RESUME_HOST)) {
local_irq_disable();
if (kvmppc_prepare_to_enter(vcpu)) {
s = kvmppc_prepare_to_enter(vcpu);
if (s <= 0) {
local_irq_enable();
run->exit_reason = KVM_EXIT_INTR;
r = (-EINTR << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
kvmppc_account_exit(vcpu, SIGNAL_EXITS);
r = (s << 2) | RESUME_HOST | (r & RESUME_FLAG_NV);
} else {
kvmppc_lazy_ee_enable();
}
Expand Down
11 changes: 8 additions & 3 deletions trunk/arch/powerpc/kvm/powerpc.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,11 +53,14 @@ int kvm_arch_vcpu_should_kick(struct kvm_vcpu *vcpu)
* Common checks before entering the guest world. Call with interrupts
* disabled.
*
* returns !0 if a signal is pending and check_signal is true
* returns:
*
* == 1 if we're ready to go into guest state
* <= 0 if we need to go back to the host with return value
*/
int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
{
int r = 0;
int r = 1;

WARN_ON_ONCE(!irqs_disabled());
while (true) {
Expand All @@ -69,7 +72,9 @@ int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
}

if (signal_pending(current)) {
r = 1;
kvmppc_account_exit(vcpu, SIGNAL_EXITS);
vcpu->run->exit_reason = KVM_EXIT_INTR;
r = -EINTR;
break;
}

Expand Down

0 comments on commit 31f9aaf

Please sign in to comment.