Re: [patch 6/7] x86/kvmclock: Move kvmclock vsyscall param and init to kvmclock

From: Pavel Tatashin
Date: Wed Jul 11 2018 - 22:53:35 EST


+#include <asm/hypervisor.h>

Can be removed, because as Paolo, noticed X86_HYPER_KVM check is not needed.

> +static int __init kvm_setup_vsyscall_timeinfo(void)
> +{
> +#ifdef CONFIG_X86_64
> + u8 flags;
> +
> + if (!hv_clock || !kvmclock_vsyscall)
> + return 0;
> +
> + flags = pvclock_read_flags(&hv_clock[0].pvti);
> + if (!(flags & PVCLOCK_TSC_STABLE_BIT))
> + return 1;
> +
> + pvclock_set_pvti_cpu0_va(hv_clock);
> + kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK;
> +#endif
> + return 0;
> +}
> +early_initcall(kvm_setup_vsyscall_timeinfo);
> +
....
> -
> -int __init kvm_setup_vsyscall_timeinfo(void)
> -{
> -#ifdef CONFIG_X86_64
> - u8 flags;
> -
> - if (!hv_clock)
> - return 0;
> -
> - flags = pvclock_read_flags(&hv_clock[0].pvti);
> - if (!(flags & PVCLOCK_TSC_STABLE_BIT))
> - return 1;
> -
> - pvclock_set_pvti_cpu0_va(hv_clock);
> - kvm_clock.archdata.vclock_mode = VCLOCK_PVCLOCK;
> -#endif
> - return 0;
> -}

I am not sure what the point of moving this function. The patch would
be much smaller without it.

Reviewed-by: Pavel Tatashin <pasha.tatashin@xxxxxxxxxx>