diff options
author | Stefano Stabellini <stefano.stabellini@eu.citrix.com> | 2015-11-23 13:35:12 +0300 |
---|---|---|
committer | David Vrabel <david.vrabel@citrix.com> | 2015-12-21 17:40:55 +0300 |
commit | 34e38523d586ae1e838241d44c8a2e9a1c9e0b43 (patch) | |
tree | d9245bb2404b0ef0c4d4e901d7416ce7ab2633c1 /arch/arm/xen/enlighten.c | |
parent | dfd57bc3a5664b98eb7b477e8d7bb2591a5198cf (diff) | |
download | linux-34e38523d586ae1e838241d44c8a2e9a1c9e0b43.tar.xz |
xen/arm: account for stolen ticks
Register the runstate_memory_area with the hypervisor.
Use pv_time_ops.steal_clock to account for stolen ticks.
Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Diffstat (limited to 'arch/arm/xen/enlighten.c')
-rw-r--r-- | arch/arm/xen/enlighten.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/arm/xen/enlighten.c b/arch/arm/xen/enlighten.c index fc7ea529f462..ebbfa64e4add 100644 --- a/arch/arm/xen/enlighten.c +++ b/arch/arm/xen/enlighten.c @@ -12,6 +12,7 @@ #include <xen/page.h> #include <xen/interface/sched.h> #include <xen/xen-ops.h> +#include <asm/paravirt.h> #include <asm/xen/hypervisor.h> #include <asm/xen/hypercall.h> #include <asm/system_misc.h> @@ -79,6 +80,19 @@ int xen_unmap_domain_gfn_range(struct vm_area_struct *vma, } EXPORT_SYMBOL_GPL(xen_unmap_domain_gfn_range); +static unsigned long long xen_stolen_accounting(int cpu) +{ + struct vcpu_runstate_info state; + + BUG_ON(cpu != smp_processor_id()); + + xen_get_runstate_snapshot(&state); + + WARN_ON(state.state != RUNSTATE_running); + + return state.time[RUNSTATE_runnable] + state.time[RUNSTATE_offline]; +} + static void xen_percpu_init(void) { struct vcpu_register_vcpu_info info; @@ -104,6 +118,8 @@ static void xen_percpu_init(void) BUG_ON(err); per_cpu(xen_vcpu, cpu) = vcpup; + xen_setup_runstate_info(cpu); + after_register_vcpu_info: enable_percpu_irq(xen_events_irq, 0); put_cpu(); @@ -271,6 +287,9 @@ static int __init xen_guest_init(void) register_cpu_notifier(&xen_cpu_notifier); + pv_time_ops.steal_clock = xen_stolen_accounting; + static_key_slow_inc(¶virt_steal_enabled); + return 0; } early_initcall(xen_guest_init); |