Re: [PATCH v3] xen: add steal_clock support on x86

From: Boris Ostrovsky
Date: Thu May 19 2016 - 09:43:50 EST


On 05/19/2016 09:26 AM, Juergen Gross wrote:
> The pv_time_ops structure contains a function pointer for the
> "steal_clock" functionality used only by KVM and Xen on ARM. Xen on x86
> uses its own mechanism to account for the "stolen" time a thread wasn't
> able to run due to hypervisor scheduling.
>
> Add support in Xen arch independent time handling for this feature by
> moving it out of the arm arch into drivers/xen and remove the x86 Xen
> hack.
>
> Signed-off-by: Juergen Gross <jgross@xxxxxxxx>

Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>

I think this also needs to be acked by (or at least copied to) generic
Linux maintainers.

> ---
> arch/arm/xen/enlighten.c | 17 ++---------------
> arch/x86/xen/time.c | 44 ++------------------------------------------
> drivers/xen/time.c | 20 ++++++++++++++++++++
> include/linux/kernel_stat.h | 1 -
> include/xen/xen-ops.h | 1 +
> kernel/sched/cputime.c | 10 ----------
> 6 files changed, 25 insertions(+), 68 deletions(-)

...

> }
> diff --git a/drivers/xen/time.c b/drivers/xen/time.c
> index 7107842..2257b66 100644
> --- a/drivers/xen/time.c
> +++ b/drivers/xen/time.c
> @@ -6,6 +6,7 @@
> #include <linux/math64.h>
> #include <linux/gfp.h>
>
> +#include <asm/paravirt.h>
> #include <asm/xen/hypervisor.h>
> #include <asm/xen/hypercall.h>
>
> @@ -75,6 +76,15 @@ bool xen_vcpu_stolen(int vcpu)
> return per_cpu(xen_runstate, vcpu).state == RUNSTATE_runnable;
> }

(Unrelated to this patch.) Should this include RUNSTATE_offline as well?

-boris