* arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
@ 2025-06-28 0:06 kernel test robot
0 siblings, 0 replies; 7+ messages in thread
From: kernel test robot @ 2025-06-28 0:06 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Maxim Levitsky <mlevitsk@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 35e261cd95ddc741d8664f5ac897bbd0d384bbd0
commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
date: 4 weeks ago
:::::: branch date: 5 hours ago
:::::: commit date: 4 weeks ago
config: riscv-randconfig-r072-20250627 (https://download.01.org/0day-ci/archive/20250628/202506280806.kYb83jgO-lkp@intel.com/config)
compiler: clang version 18.1.8 (https://github.com/llvm/llvm-project 3b5b5c1ec4a3095ab096dd780e84d7ab81f3d7ff)
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202506280806.kYb83jgO-lkp@intel.com/
New smatch warnings:
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
Old smatch warnings:
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1384 kvm_for_each_vcpu(j, vcpu, kvm) {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1393 int kvm_lock_all_vcpus(struct kvm *kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1394 {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1395 struct kvm_vcpu *vcpu;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1396 unsigned long i, j;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1397 int r;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1398
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1399 lockdep_assert_held(&kvm->lock);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1400
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1401 kvm_for_each_vcpu(i, vcpu, kvm) {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1402 r = mutex_lock_killable_nest_lock(&vcpu->mutex, &kvm->lock);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1403 if (r)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1404 goto out_unlock;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1405 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1406 return 0;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1407
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1408 out_unlock:
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1409 kvm_for_each_vcpu(j, vcpu, kvm) {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1410 if (i == j)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1411 break;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1412 mutex_unlock(&vcpu->mutex);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1413 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1414 return r;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1415 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1416 EXPORT_SYMBOL_GPL(kvm_lock_all_vcpus);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1417
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1418 void kvm_unlock_all_vcpus(struct kvm *kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1419 {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1420 struct kvm_vcpu *vcpu;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1421 unsigned long i;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1422
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1423 lockdep_assert_held(&kvm->lock);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1424
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1425 kvm_for_each_vcpu(i, vcpu, kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1426 mutex_unlock(&vcpu->mutex);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1427 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1428 EXPORT_SYMBOL_GPL(kvm_unlock_all_vcpus);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1429
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread* arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
@ 2025-12-19 19:40 kernel test robot
2026-01-05 8:31 ` Dan Carpenter
0 siblings, 1 reply; 7+ messages in thread
From: kernel test robot @ 2025-12-19 19:40 UTC (permalink / raw)
To: oe-kbuild; +Cc: lkp, Dan Carpenter
BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
CC: linux-kernel@vger.kernel.org
TO: Maxim Levitsky <mlevitsk@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: dd9b004b7ff3289fb7bae35130c0a5c0537266af
commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
date: 7 months ago
:::::: branch date: 22 hours ago
:::::: commit date: 7 months ago
config: riscv-randconfig-r073-20251214 (https://download.01.org/0day-ci/archive/20251220/202512200337.um368Um1-lkp@intel.com/config)
compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202512200337.um368Um1-lkp@intel.com/
New smatch warnings:
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
Old smatch warnings:
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1384 kvm_for_each_vcpu(j, vcpu, kvm) {
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
2025-12-19 19:40 kernel test robot
@ 2026-01-05 8:31 ` Dan Carpenter
2026-01-08 9:23 ` Dan Carpenter
2026-01-08 16:27 ` Philip Li
0 siblings, 2 replies; 7+ messages in thread
From: Dan Carpenter @ 2026-01-05 8:31 UTC (permalink / raw)
To: kernel test robot; +Cc: oe-kbuild-all
Hi,
I'm going to be taking a break from reporting Smatch warnings until we
can work out new funding for it. I'm pretty confident that we will be
able to but there wasn't a lot of notice and everyone was off for the
Holiday Season so we haven't really started the fund raising process.
https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/
I imagine that we should just send these warnings directly, but there
are some which are obvious false positives so I'd like to clean that
up before we start sending unfiltered warnings.
I've never been able to reproduce these warnings "iterator 'i' not
incremented" false positives. I've tried deleting my cross function
database and using the exact same config and everything I know how to
reproduce them but I can't. Are you using the latest version of
Smatch?
regards,
dan carpenter
On Sat, Dec 20, 2025 at 03:40:19AM +0800, kernel test robot wrote:
> BCC: lkp@intel.com
> CC: oe-kbuild-all@lists.linux.dev
> CC: linux-kernel@vger.kernel.org
> TO: Maxim Levitsky <mlevitsk@redhat.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
>
> tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head: dd9b004b7ff3289fb7bae35130c0a5c0537266af
> commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
> date: 7 months ago
> :::::: branch date: 22 hours ago
> :::::: commit date: 7 months ago
> config: riscv-randconfig-r073-20251214 (https://download.01.org/0day-ci/archive/20251220/202512200337.um368Um1-lkp@intel.com/config)
> compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
>
> 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>
> | Reported-by: Dan Carpenter <error27@gmail.com>
> | Closes: https://lore.kernel.org/r/202512200337.um368Um1-lkp@intel.com/
>
> New smatch warnings:
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
>
> Old smatch warnings:
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
> include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
> arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
>
> vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
>
> 6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1384 kvm_for_each_vcpu(j, vcpu, kvm) {
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
> e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
2026-01-05 8:31 ` Dan Carpenter
@ 2026-01-08 9:23 ` Dan Carpenter
2026-01-08 10:00 ` Philip Li
2026-01-08 16:27 ` Philip Li
1 sibling, 1 reply; 7+ messages in thread
From: Dan Carpenter @ 2026-01-08 9:23 UTC (permalink / raw)
To: Philip Li, Yujie Liu, kernel test robot; +Cc: oe-kbuild-all
Hi Philip,
Sorry for not CC'ing you on this email. Do you think you could help
me reproduce this warning?
regards,
dan carpenter
On Mon, Jan 05, 2026 at 11:31:26AM +0300, Dan Carpenter wrote:
> Hi,
>
> I'm going to be taking a break from reporting Smatch warnings until we
> can work out new funding for it. I'm pretty confident that we will be
> able to but there wasn't a lot of notice and everyone was off for the
> Holiday Season so we haven't really started the fund raising process.
>
> https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/
>
> I imagine that we should just send these warnings directly, but there
> are some which are obvious false positives so I'd like to clean that
> up before we start sending unfiltered warnings.
>
> I've never been able to reproduce these warnings "iterator 'i' not
> incremented" false positives. I've tried deleting my cross function
> database and using the exact same config and everything I know how to
> reproduce them but I can't. Are you using the latest version of
> Smatch?
>
> regards,
> dan carpenter
>
> On Sat, Dec 20, 2025 at 03:40:19AM +0800, kernel test robot wrote:
> > BCC: lkp@intel.com
> > CC: oe-kbuild-all@lists.linux.dev
> > CC: linux-kernel@vger.kernel.org
> > TO: Maxim Levitsky <mlevitsk@redhat.com>
> > CC: Paolo Bonzini <pbonzini@redhat.com>
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: dd9b004b7ff3289fb7bae35130c0a5c0537266af
> > commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
> > date: 7 months ago
> > :::::: branch date: 22 hours ago
> > :::::: commit date: 7 months ago
> > config: riscv-randconfig-r073-20251214 (https://download.01.org/0day-ci/archive/20251220/202512200337.um368Um1-lkp@intel.com/config)
> > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
> >
> > 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>
> > | Reported-by: Dan Carpenter <error27@gmail.com>
> > | Closes: https://lore.kernel.org/r/202512200337.um368Um1-lkp@intel.com/
> >
> > New smatch warnings:
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
> >
> > Old smatch warnings:
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
> > include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
> >
> > vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
> >
> > 6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1384 kvm_for_each_vcpu(j, vcpu, kvm) {
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
> >
> > --
> > 0-DAY CI Kernel Test Service
> > https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
2026-01-08 9:23 ` Dan Carpenter
@ 2026-01-08 10:00 ` Philip Li
0 siblings, 0 replies; 7+ messages in thread
From: Philip Li @ 2026-01-08 10:00 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kernel test robot, oe-kbuild-all
On Thu, Jan 08, 2026 at 12:23:30PM +0300, Dan Carpenter wrote:
> Hi Philip,
>
> Sorry for not CC'ing you on this email. Do you think you could help
> me reproduce this warning?
Got it, we will follow up to check this.
And sorry for missing the initial mail, usually send to lkp@intel.com is ok
but i wrongly think this is a mail that reports issue out and not check in time.
BTW: remove Yujie from cc, who is no longer working on 0day.
>
> regards,
> dan carpenter
>
> On Mon, Jan 05, 2026 at 11:31:26AM +0300, Dan Carpenter wrote:
> > Hi,
> >
> > I'm going to be taking a break from reporting Smatch warnings until we
> > can work out new funding for it. I'm pretty confident that we will be
> > able to but there wasn't a lot of notice and everyone was off for the
> > Holiday Season so we haven't really started the fund raising process.
> >
> > https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/
> >
> > I imagine that we should just send these warnings directly, but there
> > are some which are obvious false positives so I'd like to clean that
> > up before we start sending unfiltered warnings.
> >
> > I've never been able to reproduce these warnings "iterator 'i' not
> > incremented" false positives. I've tried deleting my cross function
> > database and using the exact same config and everything I know how to
> > reproduce them but I can't. Are you using the latest version of
> > Smatch?
> >
> > regards,
> > dan carpenter
> >
> > On Sat, Dec 20, 2025 at 03:40:19AM +0800, kernel test robot wrote:
> > > BCC: lkp@intel.com
> > > CC: oe-kbuild-all@lists.linux.dev
> > > CC: linux-kernel@vger.kernel.org
> > > TO: Maxim Levitsky <mlevitsk@redhat.com>
> > > CC: Paolo Bonzini <pbonzini@redhat.com>
> > >
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > head: dd9b004b7ff3289fb7bae35130c0a5c0537266af
> > > commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
> > > date: 7 months ago
> > > :::::: branch date: 22 hours ago
> > > :::::: commit date: 7 months ago
> > > config: riscv-randconfig-r073-20251214 (https://download.01.org/0day-ci/archive/20251220/202512200337.um368Um1-lkp@intel.com/config)
> > > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
> > >
> > > 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>
> > > | Reported-by: Dan Carpenter <error27@gmail.com>
> > > | Closes: https://lore.kernel.org/r/202512200337.um368Um1-lkp@intel.com/
> > >
> > > New smatch warnings:
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
> > >
> > > Old smatch warnings:
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
> > > include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
> > >
> > > vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
> > >
> > > 6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1384 kvm_for_each_vcpu(j, vcpu, kvm) {
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
> > >
> > > --
> > > 0-DAY CI Kernel Test Service
> > > https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
2026-01-05 8:31 ` Dan Carpenter
2026-01-08 9:23 ` Dan Carpenter
@ 2026-01-08 16:27 ` Philip Li
2026-01-09 10:32 ` Philip Li
1 sibling, 1 reply; 7+ messages in thread
From: Philip Li @ 2026-01-08 16:27 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kernel test robot, oe-kbuild-all
On Mon, Jan 05, 2026 at 11:31:26AM +0300, Dan Carpenter wrote:
> Hi,
>
> I'm going to be taking a break from reporting Smatch warnings until we
> can work out new funding for it. I'm pretty confident that we will be
Thanks for letting us know, and hope everything goes smooth for this great
tool. If there's anything that we can assist such as running smatch more
productive, kindly let me know.
> able to but there wasn't a lot of notice and everyone was off for the
> Holiday Season so we haven't really started the fund raising process.
>
> https://lore.kernel.org/all/aTaiGSbWZ9DJaGo7@stanley.mountain/
>
> I imagine that we should just send these warnings directly, but there
> are some which are obvious false positives so I'd like to clean that
> up before we start sending unfiltered warnings.
>
> I've never been able to reproduce these warnings "iterator 'i' not
> incremented" false positives. I've tried deleting my cross function
Sorry for the reproduce problem, let me further check.
> database and using the exact same config and everything I know how to
> reproduce them but I can't. Are you using the latest version of
> Smatch?
The version bot uses during Dec 20 2025 is
3a2a0587 kernel: add some more once_through macros
And I will upgrade the smatch to latest after trying the reproduce
in current bot enviroment.
>
> regards,
> dan carpenter
>
> On Sat, Dec 20, 2025 at 03:40:19AM +0800, kernel test robot wrote:
> > BCC: lkp@intel.com
> > CC: oe-kbuild-all@lists.linux.dev
> > CC: linux-kernel@vger.kernel.org
> > TO: Maxim Levitsky <mlevitsk@redhat.com>
> > CC: Paolo Bonzini <pbonzini@redhat.com>
> >
> > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > head: dd9b004b7ff3289fb7bae35130c0a5c0537266af
> > commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
> > date: 7 months ago
> > :::::: branch date: 22 hours ago
> > :::::: commit date: 7 months ago
> > config: riscv-randconfig-r073-20251214 (https://download.01.org/0day-ci/archive/20251220/202512200337.um368Um1-lkp@intel.com/config)
> > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
> >
> > 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>
> > | Reported-by: Dan Carpenter <error27@gmail.com>
> > | Closes: https://lore.kernel.org/r/202512200337.um368Um1-lkp@intel.com/
> >
> > New smatch warnings:
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
> >
> > Old smatch warnings:
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
> > include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
> > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
> >
> > vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
> >
> > 6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1384 kvm_for_each_vcpu(j, vcpu, kvm) {
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
> > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
> >
> > --
> > 0-DAY CI Kernel Test Service
> > https://github.com/intel/lkp-tests/wiki
>
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
2026-01-08 16:27 ` Philip Li
@ 2026-01-09 10:32 ` Philip Li
0 siblings, 0 replies; 7+ messages in thread
From: Philip Li @ 2026-01-09 10:32 UTC (permalink / raw)
To: Dan Carpenter; +Cc: kernel test robot, oe-kbuild-all
On Fri, Jan 09, 2026 at 12:27:30AM +0800, Philip Li wrote:
> On Mon, Jan 05, 2026 at 11:31:26AM +0300, Dan Carpenter wrote:
...
> > I've never been able to reproduce these warnings "iterator 'i' not
> > incremented" false positives. I've tried deleting my cross function
>
> Sorry for the reproduce problem, let me further check.
>
> > database and using the exact same config and everything I know how to
> > reproduce them but I can't. Are you using the latest version of
> > Smatch?
>
> The version bot uses during Dec 20 2025 is
>
> 3a2a0587 kernel: add some more once_through macros
>
> And I will upgrade the smatch to latest after trying the reproduce
> in current bot enviroment.
Hi Dan, it can reproduce the "not incremented" warning with 3a2a0587
or latest 2614ff1a commit.
Not sure whether it is caused by the way how 0day setup smatchdb and
smatch.
Can you share me which kind of info or artifacts that would help debug this,
i can upload them to downloadable place?
Thanks
>
> >
> > regards,
> > dan carpenter
> >
> > On Sat, Dec 20, 2025 at 03:40:19AM +0800, kernel test robot wrote:
> > > BCC: lkp@intel.com
> > > CC: oe-kbuild-all@lists.linux.dev
> > > CC: linux-kernel@vger.kernel.org
> > > TO: Maxim Levitsky <mlevitsk@redhat.com>
> > > CC: Paolo Bonzini <pbonzini@redhat.com>
> > >
> > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> > > head: dd9b004b7ff3289fb7bae35130c0a5c0537266af
> > > commit: e4a454ced74c0ac97c8bd32f086ee3ad74528780 KVM: add kvm_lock_all_vcpus and kvm_trylock_all_vcpus
> > > date: 7 months ago
> > > :::::: branch date: 22 hours ago
> > > :::::: commit date: 7 months ago
> > > config: riscv-randconfig-r073-20251214 (https://download.01.org/0day-ci/archive/20251220/202512200337.um368Um1-lkp@intel.com/config)
> > > compiler: clang version 22.0.0git (https://github.com/llvm/llvm-project 1335a05ab8bc8339ce24be3a9da89d8c3f4e0571)
> > >
> > > 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>
> > > | Reported-by: Dan Carpenter <error27@gmail.com>
> > > | Closes: https://lore.kernel.org/r/202512200337.um368Um1-lkp@intel.com/
> > >
> > > New smatch warnings:
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented
> > >
> > > Old smatch warnings:
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:283 kvm_make_all_cpus_request() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:487 kvm_destroy_vcpus() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1384 kvm_trylock_all_vcpus() warn: iterator 'j' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1401 kvm_lock_all_vcpus() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1409 kvm_lock_all_vcpus() warn: iterator 'j' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1425 kvm_unlock_all_vcpus() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1721 kvm_commit_memory_region() error: we previously assumed 'old' could be null (see line 1714)
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1723 kvm_commit_memory_region() error: we previously assumed 'new' could be null (see line 1715)
> > > include/linux/kvm_host.h:1010 kvm_get_vcpu_by_id() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:4961 kvm_vm_ioctl_reset_dirty_pages() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6092 kvm_get_stat_per_vcpu() warn: iterator 'i' not incremented
> > > arch/riscv/kvm/../../../virt/kvm/kvm_main.c:6103 kvm_clear_stat_per_vcpu() warn: iterator 'i' not incremented
> > >
> > > vim +/i +1378 arch/riscv/kvm/../../../virt/kvm/kvm_main.c
> > >
> > > 6aa8b732ca01c3d drivers/kvm/kvm_main.c Avi Kivity 2006-12-10 1370
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1371 int kvm_trylock_all_vcpus(struct kvm *kvm)
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1372 {
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1373 struct kvm_vcpu *vcpu;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1374 unsigned long i, j;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1375
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1376 lockdep_assert_held(&kvm->lock);
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1377
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 @1378 kvm_for_each_vcpu(i, vcpu, kvm)
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1379 if (!mutex_trylock_nest_lock(&vcpu->mutex, &kvm->lock))
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1380 goto out_unlock;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1381 return 0;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1382
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1383 out_unlock:
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1384 kvm_for_each_vcpu(j, vcpu, kvm) {
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1385 if (i == j)
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1386 break;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1387 mutex_unlock(&vcpu->mutex);
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1388 }
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1389 return -EINTR;
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1390 }
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1391 EXPORT_SYMBOL_GPL(kvm_trylock_all_vcpus);
> > > e4a454ced74c0ac virt/kvm/kvm_main.c Maxim Levitsky 2025-05-12 1392
> > >
> > > --
> > > 0-DAY CI Kernel Test Service
> > > https://github.com/intel/lkp-tests/wiki
> >
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-01-09 10:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-28 0:06 arch/riscv/kvm/../../../virt/kvm/kvm_main.c:1378 kvm_trylock_all_vcpus() warn: iterator 'i' not incremented kernel test robot
-- strict thread matches above, loose matches on Subject: below --
2025-12-19 19:40 kernel test robot
2026-01-05 8:31 ` Dan Carpenter
2026-01-08 9:23 ` Dan Carpenter
2026-01-08 10:00 ` Philip Li
2026-01-08 16:27 ` Philip Li
2026-01-09 10:32 ` Philip Li
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.