All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-next:master 11276/13479] arch/s390/kvm/kvm-s390.c:5857 kvm_arch_commit_memory_region() error: we previously assumed 'old' could be null (see line 5849)
@ 2026-08-07 12:03 kernel test robot
  0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2026-08-07 12:03 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Claudio Imbrenda <imbrenda@linux.ibm.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   ea2bff00da89d7767d677bb68470130ba96f4928
commit: ec215346270512db60478e45e8dff2de950225aa [11276/13479] KVM: s390: cmma: Fix dirty tracking when removing memslot
:::::: branch date: 21 hours ago
:::::: commit date: 4 days ago
config: s390-randconfig-r072-20260807 (https://download.01.org/0day-ci/archive/20260807/202608071937.ZHB4HrAF-lkp@intel.com/config)
compiler: s390-linux-gcc (GCC) 8.5.0
smatch: v0.5.0-9187-g5189e3fb

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/202608071937.ZHB4HrAF-lkp@intel.com/

New smatch warnings:
arch/s390/kvm/kvm-s390.c:5857 kvm_arch_commit_memory_region() error: we previously assumed 'old' could be null (see line 5849)

Old smatch warnings:
arch/s390/kvm/kvm-s390.c:5788 kvm_arch_prepare_memory_region() error: we previously assumed 'new' could be null (see line 5774)

vim +/old +5857 arch/s390/kvm/kvm-s390.c

ec215346270512 Claudio Imbrenda      2026-08-03  5827  
f7784b8ec9b6a0 Marcelo Tosatti       2009-12-23  5828  void kvm_arch_commit_memory_region(struct kvm *kvm,
9d4c197c0e94c3 Sean Christopherson   2020-02-18  5829  				struct kvm_memory_slot *old,
f36f3f2846b557 Paolo Bonzini         2015-05-18  5830  				const struct kvm_memory_slot *new,
8482644aea11e0 Takuya Yoshikawa      2013-02-27  5831  				enum kvm_mr_change change)
f7784b8ec9b6a0 Marcelo Tosatti       2009-12-23  5832  {
ec215346270512 Claudio Imbrenda      2026-08-03  5833  	const struct dat_walk_ops ops = { .pte_entry = cmma_d_count_pte, };
ec215346270512 Claudio Imbrenda      2026-08-03  5834  	struct kvm_s390_mmu_cache *mc __free(kvm_s390_mmu_cache) = NULL;
19ec166c3f39fe Christian Borntraeger 2019-05-24  5835  	int rc = 0;
598841ca9919d0 Carsten Otte          2011-07-24  5836  
ec215346270512 Claudio Imbrenda      2026-08-03  5837  	guard(mutex)(&kvm->slots_arch_lock);
ec215346270512 Claudio Imbrenda      2026-08-03  5838  
e38c884df92119 Claudio Imbrenda      2026-02-04  5839  	if (change == KVM_MR_FLAGS_ONLY)
413c98f24c63b3 Claudio Imbrenda      2025-01-23  5840  		return;
413c98f24c63b3 Claudio Imbrenda      2025-01-23  5841  
e38c884df92119 Claudio Imbrenda      2026-02-04  5842  	mc = kvm_s390_new_mmu_cache();
e38c884df92119 Claudio Imbrenda      2026-02-04  5843  	if (!mc) {
e38c884df92119 Claudio Imbrenda      2026-02-04  5844  		rc = -ENOMEM;
e38c884df92119 Claudio Imbrenda      2026-02-04  5845  		goto out;
e38c884df92119 Claudio Imbrenda      2026-02-04  5846  	}
e38c884df92119 Claudio Imbrenda      2026-02-04  5847  
e38c884df92119 Claudio Imbrenda      2026-02-04  5848  	scoped_guard(write_lock, &kvm->mmu_lock) {
ec215346270512 Claudio Imbrenda      2026-08-03 @5849  		if (kvm->arch.migration_mode && kvm->arch.use_cmma && old) {
ec215346270512 Claudio Imbrenda      2026-08-03  5850  			_dat_walk_gfn_range(old->base_gfn, old->base_gfn + old->npages,
ec215346270512 Claudio Imbrenda      2026-08-03  5851  					    kvm->arch.gmap->asce, &ops, DAT_WALK_IGN_HOLES,
ec215346270512 Claudio Imbrenda      2026-08-03  5852  					    &kvm->arch.cmma_dirty_pages);
ec215346270512 Claudio Imbrenda      2026-08-03  5853  		}
ec215346270512 Claudio Imbrenda      2026-08-03  5854  
19ec166c3f39fe Christian Borntraeger 2019-05-24  5855  		switch (change) {
19ec166c3f39fe Christian Borntraeger 2019-05-24  5856  		case KVM_MR_DELETE:
e38c884df92119 Claudio Imbrenda      2026-02-04 @5857  			rc = dat_delete_slot(mc, kvm->arch.gmap->asce, old->base_gfn, old->npages);
19ec166c3f39fe Christian Borntraeger 2019-05-24  5858  			break;
19ec166c3f39fe Christian Borntraeger 2019-05-24  5859  		case KVM_MR_MOVE:
e38c884df92119 Claudio Imbrenda      2026-02-04  5860  			rc = dat_delete_slot(mc, kvm->arch.gmap->asce, old->base_gfn, old->npages);
19ec166c3f39fe Christian Borntraeger 2019-05-24  5861  			if (rc)
19ec166c3f39fe Christian Borntraeger 2019-05-24  5862  				break;
3b684a420bd8a2 Joe Perches           2020-03-10  5863  			fallthrough;
19ec166c3f39fe Christian Borntraeger 2019-05-24  5864  		case KVM_MR_CREATE:
e38c884df92119 Claudio Imbrenda      2026-02-04  5865  			rc = dat_create_slot(mc, kvm->arch.gmap->asce, new->base_gfn, new->npages);
19ec166c3f39fe Christian Borntraeger 2019-05-24  5866  			break;
19ec166c3f39fe Christian Borntraeger 2019-05-24  5867  		case KVM_MR_FLAGS_ONLY:
19ec166c3f39fe Christian Borntraeger 2019-05-24  5868  			break;
19ec166c3f39fe Christian Borntraeger 2019-05-24  5869  		default:
19ec166c3f39fe Christian Borntraeger 2019-05-24  5870  			WARN(1, "Unknown KVM MR CHANGE: %d\n", change);
19ec166c3f39fe Christian Borntraeger 2019-05-24  5871  		}
e38c884df92119 Claudio Imbrenda      2026-02-04  5872  	}
e38c884df92119 Claudio Imbrenda      2026-02-04  5873  out:
598841ca9919d0 Carsten Otte          2011-07-24  5874  	if (rc)
ea2cdd27dce66d David Hildenbrand     2015-05-20  5875  		pr_warn("failed to commit memory region\n");
598841ca9919d0 Carsten Otte          2011-07-24  5876  	return;
b0c632db637d68 Heiko Carstens        2008-03-25  5877  }
b0c632db637d68 Heiko Carstens        2008-03-25  5878  

:::::: The code at line 5857 was first introduced by commit
:::::: e38c884df92119d96f652d51f82661dd2fc0b885 KVM: s390: Switch to new gmap

:::::: TO: Claudio Imbrenda <imbrenda@linux.ibm.com>
:::::: CC: Claudio Imbrenda <imbrenda@linux.ibm.com>

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2026-08-07 12:04 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-07 12:03 [linux-next:master 11276/13479] arch/s390/kvm/kvm-s390.c:5857 kvm_arch_commit_memory_region() error: we previously assumed 'old' could be null (see line 5849) kernel test robot

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.