Re: [PATCH v2 01/12] KVM: x86: Report host tsc and realtime values in KVM_GET_CLOCK

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

 



Hi Oliver,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on kvm/queue]
[also build test WARNING on vhost/linux-next v5.14-rc1 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-controls-for-migrating-system-counter-state/20210718-103407
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
config: x86_64-rhel-8.3-kselftests (attached as .config)
compiler: gcc-10 (Ubuntu 10.3.0-1ubuntu1~20.04) 10.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-341-g8af24329-dirty
        # https://github.com/0day-ci/linux/commit/72b6d584e6ac692038a7d70e8782f0dfa179e5fb
        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 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>

All warnings (new ones prefixed by >>):

>> arch/x86/kvm/x86.c:2784: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst
    * Returns true if realtime and TSC values were written back to the caller.


vim +2784 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@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip

_______________________________________________
kvmarm mailing list
kvmarm@xxxxxxxxxxxxxxxxxxxxx
https://lists.cs.columbia.edu/mailman/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