diff options
Diffstat (limited to 'arch/powerpc/kvm/booke.c')
-rw-r--r-- | arch/powerpc/kvm/booke.c | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c index 1d4ce9a80f55..bcf87fe89179 100644 --- a/arch/powerpc/kvm/booke.c +++ b/arch/powerpc/kvm/booke.c | |||
@@ -419,13 +419,6 @@ static void kvmppc_core_check_exceptions(struct kvm_vcpu *vcpu) | |||
419 | unsigned long *pending = &vcpu->arch.pending_exceptions; | 419 | unsigned long *pending = &vcpu->arch.pending_exceptions; |
420 | unsigned int priority; | 420 | unsigned int priority; |
421 | 421 | ||
422 | if (vcpu->requests) { | ||
423 | if (kvm_check_request(KVM_REQ_PENDING_TIMER, vcpu)) { | ||
424 | smp_mb(); | ||
425 | update_timer_ints(vcpu); | ||
426 | } | ||
427 | } | ||
428 | |||
429 | priority = __ffs(*pending); | 422 | priority = __ffs(*pending); |
430 | while (priority < BOOKE_IRQPRIO_MAX) { | 423 | while (priority < BOOKE_IRQPRIO_MAX) { |
431 | if (kvmppc_booke_irqprio_deliver(vcpu, priority)) | 424 | if (kvmppc_booke_irqprio_deliver(vcpu, priority)) |
@@ -461,6 +454,14 @@ int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu) | |||
461 | return r; | 454 | return r; |
462 | } | 455 | } |
463 | 456 | ||
457 | static void kvmppc_check_requests(struct kvm_vcpu *vcpu) | ||
458 | { | ||
459 | if (vcpu->requests) { | ||
460 | if (kvm_check_request(KVM_REQ_PENDING_TIMER, vcpu)) | ||
461 | update_timer_ints(vcpu); | ||
462 | } | ||
463 | } | ||
464 | |||
464 | /* | 465 | /* |
465 | * Common checks before entering the guest world. Call with interrupts | 466 | * Common checks before entering the guest world. Call with interrupts |
466 | * disabled. | 467 | * disabled. |
@@ -485,6 +486,15 @@ static int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu) | |||
485 | break; | 486 | break; |
486 | } | 487 | } |
487 | 488 | ||
489 | smp_mb(); | ||
490 | if (vcpu->requests) { | ||
491 | /* Make sure we process requests preemptable */ | ||
492 | local_irq_enable(); | ||
493 | kvmppc_check_requests(vcpu); | ||
494 | local_irq_disable(); | ||
495 | continue; | ||
496 | } | ||
497 | |||
488 | if (kvmppc_core_prepare_to_enter(vcpu)) { | 498 | if (kvmppc_core_prepare_to_enter(vcpu)) { |
489 | /* interrupts got enabled in between, so we | 499 | /* interrupts got enabled in between, so we |
490 | are back at square 1 */ | 500 | are back at square 1 */ |