On 03.08.2012, at 07:30, Bharat Bhushan wrote:

> I am sending this as a separate patch for easiness on review.
> Once reviewed I will merge this with watchdog patch.

Please don't merge, but rather make 2 different patches out of it:

  1) Introduce kvmppc_handle_requests()
  2) Implement watchdog, including request bits

> 
> Signed-off-by: Bharat Bhushan <bharat.bhus...@freescale.com>
> ---
> arch/powerpc/kvm/booke.c |   63 +++++++++++++++++++++++++++-------------------
> 1 files changed, 37 insertions(+), 26 deletions(-)
> 
> diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c
> index a0f5922..68ed863 100644
> --- a/arch/powerpc/kvm/booke.c
> +++ b/arch/powerpc/kvm/booke.c
> @@ -525,18 +525,31 @@ static void update_timer_ints(struct kvm_vcpu *vcpu)
>               kvmppc_core_dequeue_watchdog(vcpu);
> }
> 
> +static int kvmppc_handle_requests(struct kvm_run *run, struct kvm_vcpu *vcpu)
> +{
> +     int ret = 0;
> +
> +     if (!vcpu->requests)
> +             return 0;
> +
> +     if (kvm_check_request(KVM_REQ_PENDING_TIMER, vcpu)) {
> +             smp_mb();
> +             update_timer_ints(vcpu);
> +     }
> +
> +     if (kvm_check_request(KVM_REQ_WATCHDOG, vcpu)) {
> +             run->exit_reason = KVM_EXIT_WATCHDOG;
> +             ret = 1;
> +     }
> +
> +     return ret;
> +}
> +
> static void kvmppc_core_check_exceptions(struct kvm_vcpu *vcpu)
> {
>       unsigned long *pending = &vcpu->arch.pending_exceptions;
>       unsigned int priority;
> 
> -     if (vcpu->requests) {
> -             if (kvm_check_request(KVM_REQ_PENDING_TIMER, vcpu)) {
> -                     smp_mb();
> -                     update_timer_ints(vcpu);
> -             }
> -     }
> -
>       priority = __ffs(*pending);
>       while (priority < BOOKE_IRQPRIO_MAX) {
>               if (kvmppc_booke_irqprio_deliver(vcpu, priority))
> @@ -578,7 +591,7 @@ int kvmppc_core_prepare_to_enter(struct kvm_vcpu *vcpu)
>  *
>  * returns !0 if a signal is pending and check_signal is true
>  */
> -static int kvmppc_prepare_to_enter(struct kvm_vcpu *vcpu)
> +static int kvmppc_prepare_to_enter(struct kvm_run *run, struct kvm_vcpu 
> *vcpu)

You can always get to run via vcpu->run. Every time we pass in run as 
parameter, we're using a deprecated kvm calling convention.

Otherwise looks good to me :)


Alex

--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to