Hi Oliver,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on kvm/queue]
[also build test ERROR on vhost/linux-next v5.14-rc2 next-20210716]
[cannot apply to kvmarm/next]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]
url:
https://github.com/0day-ci/linux/commits/Oliver-Upton/KVM-Add-idempotent-...
base:
https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
config: i386-randconfig-a013-20210718 (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce (this is a W=1 build):
#
https://github.com/0day-ci/linux/commit/72b6d584e6ac692038a7d70e8782f0dfa...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Oliver-Upton/KVM-Add-idempotent-controls-for-migrating-system-counter-state/20210718-103407
git checkout 72b6d584e6ac692038a7d70e8782f0dfa179e5fb
# save the attached .config to linux build tree
make W=1 ARCH=i386
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
All errors (new ones prefixed by >>):
arch/x86/kvm/x86.c: In function 'get_kvmclock_and_realtime':
> arch/x86/kvm/x86.c:2818:7: error: implicit declaration of
function 'kvm_get_walltime_and_clockread' [-Werror=implicit-function-declaration]
2818 | if (kvm_get_walltime_and_clockread(&ts, &tsc_val)) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +/kvm_get_walltime_and_clockread +2818 arch/x86/kvm/x86.c
2782
2783 /**
2784 * Returns true if realtime and TSC values were written back to the caller.
2785 * Returns false if a clock triplet cannot be obtained, such as if the host's
2786 * realtime clock is not based on the TSC.
2787 */
2788 static bool get_kvmclock_and_realtime(struct kvm *kvm, u64 *kvmclock_ns,
2789 u64 *realtime_ns, u64 *tsc)
2790 {
2791 struct kvm_arch *ka = &kvm->arch;
2792 struct pvclock_vcpu_time_info hv_clock;
2793 unsigned long flags;
2794 bool ret = false;
2795
2796 spin_lock_irqsave(&ka->pvclock_gtod_sync_lock, flags);
2797 if (!ka->use_master_clock) {
2798 spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags);
2799 *kvmclock_ns = get_kvmclock_base_ns() + ka->kvmclock_offset;
2800 return false;
2801 }
2802
2803 hv_clock.tsc_timestamp = ka->master_cycle_now;
2804 hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
2805 spin_unlock_irqrestore(&ka->pvclock_gtod_sync_lock, flags);
2806
2807 /* both __this_cpu_read() and rdtsc() should be on the same cpu */
2808 get_cpu();
2809
2810 if (__this_cpu_read(cpu_tsc_khz)) {
2811 struct timespec64 ts;
2812 u64 tsc_val;
2813
2814 kvm_get_time_scale(NSEC_PER_SEC, __this_cpu_read(cpu_tsc_khz) * 1000LL,
2815 &hv_clock.tsc_shift,
2816 &hv_clock.tsc_to_system_mul);
2817
2818 if (kvm_get_walltime_and_clockread(&ts, &tsc_val)) {
2819 *realtime_ns = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
2820 *tsc = tsc_val;
2821 ret = true;
2822 }
2823
2824 *kvmclock_ns = __pvclock_read_cycles(&hv_clock, tsc_val);
2825 } else
2826 *kvmclock_ns = get_kvmclock_base_ns() + ka->kvmclock_offset;
2827
2828 put_cpu();
2829
2830 return ret;
2831 }
2832
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org