lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202107271428.F5bbv8iJ-lkp@intel.com>
Date:   Tue, 27 Jul 2021 14:46:37 +0800
From:   kernel test robot <lkp@...el.com>
To:     Huacai Chen <chenhc@...ote.com>
Cc:     kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
        Paolo Bonzini <pbonzini@...hat.com>
Subject: arch/mips/kvm/vz.c:392:10: warning: variable 'freeze_time' set but
 not used

Hi Huacai,

FYI, the error/warning still remains.

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   ff1176468d368232b684f75e82563369208bc371
commit: cf99c505cf7a5b6d3deee91e3571871f20320d31 MIPS: VZ: Only include loongson_regs.h for CPU_LOONGSON64
date:   12 months ago
config: mips-randconfig-r024-20210726 (attached as .config)
compiler: mips64-linux-gcc (GCC) 10.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-10.3.0 make.cross ARCH=mips 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.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@...tec.com>
:::::: CC: James Hogan <james.hogan@...tec.com>

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

Download attachment ".config.gz" of type "application/gzip" (29710 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ