All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but not used
Date: Mon, 05 Apr 2021 10:11:59 +0800	[thread overview]
Message-ID: <202104051045.FIt4dq75-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4914 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e49d033bddf5b565044e2abe4241353959bc9120
commit: cf99c505cf7a5b6d3deee91e3571871f20320d31 MIPS: VZ: Only include loongson_regs.h for CPU_LOONGSON64
date:   8 months ago
config: mips-randconfig-r033-20210405 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cf99c505cf7a5b6d3deee91e3571871f20320d31
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout cf99c505cf7a5b6d3deee91e3571871f20320d31
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   arch/mips/kvm/vz.c: In function '_kvm_vz_restore_htimer':
>> arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but not used [-Wunused-but-set-variable]
     392 |  ktime_t freeze_time;
         |          ^~~~~~~~~~~


vim +/freeze_time +392 arch/mips/kvm/vz.c

c992a4f6a9b0a3 James Hogan 2017-03-14  378  
c992a4f6a9b0a3 James Hogan 2017-03-14  379  /**
f4474d50c7d483 James Hogan 2017-03-14  380   * _kvm_vz_restore_htimer() - Restore hard timer state.
f4474d50c7d483 James Hogan 2017-03-14  381   * @vcpu:	Virtual CPU.
f4474d50c7d483 James Hogan 2017-03-14  382   * @compare:	CP0_Compare register value, restored by caller.
f4474d50c7d483 James Hogan 2017-03-14  383   * @cause:	CP0_Cause register to restore.
f4474d50c7d483 James Hogan 2017-03-14  384   *
f4474d50c7d483 James Hogan 2017-03-14  385   * Restore hard timer Guest.Count & Guest.Cause taking care to preserve the
f4474d50c7d483 James Hogan 2017-03-14  386   * value of Guest.CP0_Cause.TI while restoring Guest.CP0_Cause.
f4474d50c7d483 James Hogan 2017-03-14  387   */
f4474d50c7d483 James Hogan 2017-03-14  388  static void _kvm_vz_restore_htimer(struct kvm_vcpu *vcpu,
f4474d50c7d483 James Hogan 2017-03-14  389  				   u32 compare, u32 cause)
f4474d50c7d483 James Hogan 2017-03-14  390  {
f4474d50c7d483 James Hogan 2017-03-14  391  	u32 start_count, after_count;
f4474d50c7d483 James Hogan 2017-03-14 @392  	ktime_t freeze_time;
f4474d50c7d483 James Hogan 2017-03-14  393  	unsigned long flags;
f4474d50c7d483 James Hogan 2017-03-14  394  
f4474d50c7d483 James Hogan 2017-03-14  395  	/*
f4474d50c7d483 James Hogan 2017-03-14  396  	 * Freeze the soft-timer and sync the guest CP0_Count with it. We do
f4474d50c7d483 James Hogan 2017-03-14  397  	 * this with interrupts disabled to avoid latency.
f4474d50c7d483 James Hogan 2017-03-14  398  	 */
f4474d50c7d483 James Hogan 2017-03-14  399  	local_irq_save(flags);
f4474d50c7d483 James Hogan 2017-03-14  400  	freeze_time = kvm_mips_freeze_hrtimer(vcpu, &start_count);
f4474d50c7d483 James Hogan 2017-03-14  401  	write_c0_gtoffset(start_count - read_c0_count());
f4474d50c7d483 James Hogan 2017-03-14  402  	local_irq_restore(flags);
f4474d50c7d483 James Hogan 2017-03-14  403  
f4474d50c7d483 James Hogan 2017-03-14  404  	/* restore guest CP0_Cause, as TI may already be set */
f4474d50c7d483 James Hogan 2017-03-14  405  	back_to_back_c0_hazard();
f4474d50c7d483 James Hogan 2017-03-14  406  	write_gc0_cause(cause);
f4474d50c7d483 James Hogan 2017-03-14  407  
f4474d50c7d483 James Hogan 2017-03-14  408  	/*
f4474d50c7d483 James Hogan 2017-03-14  409  	 * The above sequence isn't atomic and would result in lost timer
f4474d50c7d483 James Hogan 2017-03-14  410  	 * interrupts if we're not careful. Detect if a timer interrupt is due
f4474d50c7d483 James Hogan 2017-03-14  411  	 * and assert it.
f4474d50c7d483 James Hogan 2017-03-14  412  	 */
f4474d50c7d483 James Hogan 2017-03-14  413  	back_to_back_c0_hazard();
f4474d50c7d483 James Hogan 2017-03-14  414  	after_count = read_gc0_count();
f4474d50c7d483 James Hogan 2017-03-14  415  	if (after_count - start_count > compare - start_count - 1)
f4474d50c7d483 James Hogan 2017-03-14  416  		kvm_vz_queue_irq(vcpu, MIPS_EXC_INT_TIMER);
f4474d50c7d483 James Hogan 2017-03-14  417  }
f4474d50c7d483 James Hogan 2017-03-14  418  

:::::: The code at line 392 was first introduced by commit
:::::: f4474d50c7d483dd4432d5b0891b0bb9ad0eefc9 KVM: MIPS/VZ: Support hardware guest timer

:::::: TO: James Hogan <james.hogan@imgtec.com>
:::::: CC: James Hogan <james.hogan@imgtec.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 23878 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: kernel test robot <lkp@intel.com>
To: Huacai Chen <chenhc@lemote.com>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but not used
Date: Mon, 5 Apr 2021 10:11:59 +0800	[thread overview]
Message-ID: <202104051045.FIt4dq75-lkp@intel.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 4832 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   e49d033bddf5b565044e2abe4241353959bc9120
commit: cf99c505cf7a5b6d3deee91e3571871f20320d31 MIPS: VZ: Only include loongson_regs.h for CPU_LOONGSON64
date:   8 months ago
config: mips-randconfig-r033-20210405 (attached as .config)
compiler: mips-linux-gcc (GCC) 9.3.0
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=cf99c505cf7a5b6d3deee91e3571871f20320d31
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout cf99c505cf7a5b6d3deee91e3571871f20320d31
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross ARCH=mips 

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

All warnings (new ones prefixed by >>):

   arch/mips/kvm/vz.c: In function '_kvm_vz_restore_htimer':
>> arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but not used [-Wunused-but-set-variable]
     392 |  ktime_t freeze_time;
         |          ^~~~~~~~~~~


vim +/freeze_time +392 arch/mips/kvm/vz.c

c992a4f6a9b0a3 James Hogan 2017-03-14  378  
c992a4f6a9b0a3 James Hogan 2017-03-14  379  /**
f4474d50c7d483 James Hogan 2017-03-14  380   * _kvm_vz_restore_htimer() - Restore hard timer state.
f4474d50c7d483 James Hogan 2017-03-14  381   * @vcpu:	Virtual CPU.
f4474d50c7d483 James Hogan 2017-03-14  382   * @compare:	CP0_Compare register value, restored by caller.
f4474d50c7d483 James Hogan 2017-03-14  383   * @cause:	CP0_Cause register to restore.
f4474d50c7d483 James Hogan 2017-03-14  384   *
f4474d50c7d483 James Hogan 2017-03-14  385   * Restore hard timer Guest.Count & Guest.Cause taking care to preserve the
f4474d50c7d483 James Hogan 2017-03-14  386   * value of Guest.CP0_Cause.TI while restoring Guest.CP0_Cause.
f4474d50c7d483 James Hogan 2017-03-14  387   */
f4474d50c7d483 James Hogan 2017-03-14  388  static void _kvm_vz_restore_htimer(struct kvm_vcpu *vcpu,
f4474d50c7d483 James Hogan 2017-03-14  389  				   u32 compare, u32 cause)
f4474d50c7d483 James Hogan 2017-03-14  390  {
f4474d50c7d483 James Hogan 2017-03-14  391  	u32 start_count, after_count;
f4474d50c7d483 James Hogan 2017-03-14 @392  	ktime_t freeze_time;
f4474d50c7d483 James Hogan 2017-03-14  393  	unsigned long flags;
f4474d50c7d483 James Hogan 2017-03-14  394  
f4474d50c7d483 James Hogan 2017-03-14  395  	/*
f4474d50c7d483 James Hogan 2017-03-14  396  	 * Freeze the soft-timer and sync the guest CP0_Count with it. We do
f4474d50c7d483 James Hogan 2017-03-14  397  	 * this with interrupts disabled to avoid latency.
f4474d50c7d483 James Hogan 2017-03-14  398  	 */
f4474d50c7d483 James Hogan 2017-03-14  399  	local_irq_save(flags);
f4474d50c7d483 James Hogan 2017-03-14  400  	freeze_time = kvm_mips_freeze_hrtimer(vcpu, &start_count);
f4474d50c7d483 James Hogan 2017-03-14  401  	write_c0_gtoffset(start_count - read_c0_count());
f4474d50c7d483 James Hogan 2017-03-14  402  	local_irq_restore(flags);
f4474d50c7d483 James Hogan 2017-03-14  403  
f4474d50c7d483 James Hogan 2017-03-14  404  	/* restore guest CP0_Cause, as TI may already be set */
f4474d50c7d483 James Hogan 2017-03-14  405  	back_to_back_c0_hazard();
f4474d50c7d483 James Hogan 2017-03-14  406  	write_gc0_cause(cause);
f4474d50c7d483 James Hogan 2017-03-14  407  
f4474d50c7d483 James Hogan 2017-03-14  408  	/*
f4474d50c7d483 James Hogan 2017-03-14  409  	 * The above sequence isn't atomic and would result in lost timer
f4474d50c7d483 James Hogan 2017-03-14  410  	 * interrupts if we're not careful. Detect if a timer interrupt is due
f4474d50c7d483 James Hogan 2017-03-14  411  	 * and assert it.
f4474d50c7d483 James Hogan 2017-03-14  412  	 */
f4474d50c7d483 James Hogan 2017-03-14  413  	back_to_back_c0_hazard();
f4474d50c7d483 James Hogan 2017-03-14  414  	after_count = read_gc0_count();
f4474d50c7d483 James Hogan 2017-03-14  415  	if (after_count - start_count > compare - start_count - 1)
f4474d50c7d483 James Hogan 2017-03-14  416  		kvm_vz_queue_irq(vcpu, MIPS_EXC_INT_TIMER);
f4474d50c7d483 James Hogan 2017-03-14  417  }
f4474d50c7d483 James Hogan 2017-03-14  418  

:::::: The code at line 392 was first introduced by commit
:::::: f4474d50c7d483dd4432d5b0891b0bb9ad0eefc9 KVM: MIPS/VZ: Support hardware guest timer

:::::: TO: James Hogan <james.hogan@imgtec.com>
:::::: CC: James Hogan <james.hogan@imgtec.com>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 23878 bytes --]

             reply	other threads:[~2021-04-05  2:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-05  2:11 kernel test robot [this message]
2021-04-05  2:11 ` arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but not used kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2021-07-27  6:46 kernel test robot
2021-07-27  6:46 ` kernel test robot

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=202104051045.FIt4dq75-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild-all@lists.01.org \
    /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.