All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: David Woodhouse <dwmw@amazon.co.uk>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [dwmw2:kvmclock6 12/36] arch/x86/kvm/x86.c:3249:1: warning: label 'fallback' defined but not used
Date: Fri, 12 Jun 2026 18:29:01 +0800	[thread overview]
Message-ID: <202606121847.WMpRF92x-lkp@intel.com> (raw)

tree:   git://git.infradead.org/users/dwmw2/linux kvmclock6
head:   f0cde567611e75fa2459c24c7aea06d619f07f8b
commit: 0dba225ab43627430d6b2f8be1143ea133116e96 [12/36] KVM: x86: Restructure get_kvmclock()
config: i386-buildonly-randconfig-004-20260612 (https://download.01.org/0day-ci/archive/20260612/202606121847.WMpRF92x-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260612/202606121847.WMpRF92x-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202606121847.WMpRF92x-lkp@intel.com/

All warnings (new ones prefixed by >>):

   arch/x86/kvm/x86.c: In function 'get_kvmclock':
>> arch/x86/kvm/x86.c:3249:1: warning: label 'fallback' defined but not used [-Wunused-label]
    3249 | fallback:
         | ^~~~~~~~
>> arch/x86/kvm/x86.c:3206:39: warning: unused variable 'hv_clock' [-Wunused-variable]
    3206 |         struct pvclock_vcpu_time_info hv_clock;
         |                                       ^~~~~~~~


vim +/fallback +3249 arch/x86/kvm/x86.c

  3202	
  3203	static void get_kvmclock(struct kvm *kvm, struct kvm_clock_data *data)
  3204	{
  3205		struct kvm_arch *ka = &kvm->arch;
> 3206		struct pvclock_vcpu_time_info hv_clock;
  3207		unsigned int seq;
  3208	
  3209		do {
  3210			seq = read_seqcount_begin(&ka->pvclock_sc);
  3211	
  3212			data->flags = 0;
  3213	#ifdef CONFIG_X86_64
  3214			if (ka->use_master_clock) {
  3215				struct timespec64 ts;
  3216	
  3217				/*
  3218				 * The RDTSC and get_cpu_tsc_khz() must happen on
  3219				 * the same CPU.
  3220				 */
  3221				get_cpu();
  3222	
  3223				if (kvm_get_walltime_and_clockread(&ts, &data->host_tsc)) {
  3224					data->realtime = ts.tv_nsec + NSEC_PER_SEC * ts.tv_sec;
  3225					data->flags |= KVM_CLOCK_REALTIME | KVM_CLOCK_HOST_TSC;
  3226				} else {
  3227					/*
  3228					 * Clock read failed (e.g. clocksource is
  3229					 * transitioning away from TSC). Fall back to
  3230					 * the non-master-clock path rather than
  3231					 * spinning.
  3232					 */
  3233					put_cpu();
  3234					goto fallback;
  3235				}
  3236	
  3237				data->flags |= KVM_CLOCK_TSC_STABLE;
  3238				hv_clock.tsc_timestamp = ka->master_cycle_now;
  3239				hv_clock.system_time = ka->master_kernel_ns + ka->kvmclock_offset;
  3240				kvm_get_time_scale(NSEC_PER_SEC, get_cpu_tsc_khz() * 1000LL,
  3241						   &hv_clock.tsc_shift,
  3242						   &hv_clock.tsc_to_system_mul);
  3243				data->clock = __pvclock_read_cycles(&hv_clock, data->host_tsc);
  3244	
  3245				put_cpu();
  3246			} else
  3247	#endif
  3248			{
> 3249	fallback:
  3250				data->clock = get_kvmclock_base_ns() + ka->kvmclock_offset;
  3251			}
  3252		} while (read_seqcount_retry(&ka->pvclock_sc, seq));
  3253	}
  3254	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-06-12 10:29 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202606121847.WMpRF92x-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=dwmw@amazon.co.uk \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.