Re: [PATCH v2 9/9] ARM: KVM: arch_timers: Wire the init code and config option

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Jul 5, 2012 at 12:18 PM, Marc Zyngier <marc.zyngier@xxxxxxx> wrote:
> It is now possible to select CONFIG_KVM_ARM_TIMER to enable the
> KVM architected timer support.
>
> Signed-off-by: Marc Zyngier <marc.zyngier@xxxxxxx>
> ---
>  arch/arm/kvm/Kconfig  |    7 +++++++
>  arch/arm/kvm/Makefile |    1 +
>  arch/arm/kvm/arm.c    |   11 +++++++++++
>  arch/arm/kvm/vgic.c   |    4 ++++
>  4 files changed, 23 insertions(+)
>
> diff --git a/arch/arm/kvm/Kconfig b/arch/arm/kvm/Kconfig
> index 746521a..4d6e658 100644
> --- a/arch/arm/kvm/Kconfig
> +++ b/arch/arm/kvm/Kconfig
> @@ -47,6 +47,13 @@ config KVM_ARM_VGIC
>         ---help---
>           Adds support for a hardware assisted, in-kernel GIC emulation.
>
> +config KVM_ARM_TIMER
> +        bool "KVM support for Architected Timers"
> +       depends on KVM_ARM_VGIC && ARM_ARCH_TIMER
> +       select HAVE_KVM_IRQCHIP
> +       ---help---
> +         Adds support for the Architected Timed in virtual machines
> +
>  source drivers/virtio/Kconfig
>
>  endif # VIRTUALIZATION
> diff --git a/arch/arm/kvm/Makefile b/arch/arm/kvm/Makefile
> index c5c4a9f..9bd4af4 100644
> --- a/arch/arm/kvm/Makefile
> +++ b/arch/arm/kvm/Makefile
> @@ -16,3 +16,4 @@ kvm-arm-y += arm.o guest.o mmu.o emulate.o reset.o
>
>  obj-$(CONFIG_KVM) += kvm-arm.o
>  obj-$(CONFIG_KVM_ARM_VGIC) += vgic.o
> +obj-$(CONFIG_KVM_ARM_TIMER) += timer.o
> diff --git a/arch/arm/kvm/arm.c b/arch/arm/kvm/arm.c
> index 41cc5ed..7f334aa 100644
> --- a/arch/arm/kvm/arm.c
> +++ b/arch/arm/kvm/arm.c
> @@ -262,6 +262,7 @@ out:
>
>  void kvm_arch_vcpu_free(struct kvm_vcpu *vcpu)
>  {
> +       kvm_timer_vcpu_terminate(vcpu);
>         kmem_cache_free(kvm_vcpu_cache, vcpu);
>  }
>
> @@ -299,6 +300,9 @@ int kvm_arch_vcpu_init(struct kvm_vcpu *vcpu)
>         /* Set up VGIC */
>         kvm_vgic_vcpu_init(vcpu);
>
> +       /* Set up the timer */
> +       kvm_timer_vcpu_init(vcpu);
> +
>         return 0;
>  }
>
> @@ -871,6 +875,13 @@ static int init_hyp_mode(void)
>                 vgic_present = true;
>
>         /*
> +        * Init HYP architected timer support
> +        */
> +       err = kvm_timer_hyp_init();
> +       if (err)
> +               goto out_free_mappings;
> +
> +       /*
>          * Set the HVBAR to the virtual kernel address
>          */
>         for_each_online_cpu(cpu)
> diff --git a/arch/arm/kvm/vgic.c b/arch/arm/kvm/vgic.c
> index f184e97..cc835bc 100644
> --- a/arch/arm/kvm/vgic.c
> +++ b/arch/arm/kvm/vgic.c
> @@ -1033,5 +1033,9 @@ int kvm_vgic_init(struct kvm *kvm)
>
>  out:
>         mutex_unlock(&kvm->lock);
> +
> +       if (!ret)
> +               kvm_timer_init(kvm);
> +
>         return ret;
>  }
> --
> 1.7.10.3
>
>

yeah, looks good
_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/cucslists/listinfo/kvmarm


[Index of Archives]     [Linux KVM]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux