public inbox for llvm@lists.linux.dev
 help / color / mirror / Atom feed
* Re: [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing()
       [not found] <20251224023201.381586-1-yanfei.xu@bytedance.com>
@ 2025-12-24 17:35 ` kernel test robot
  2025-12-25  6:04 ` kernel test robot
  2025-12-25  9:34 ` kernel test robot
  2 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-12-24 17:35 UTC (permalink / raw)
  To: Yanfei Xu, pbonzini
  Cc: llvm, oe-kbuild-all, kvm, caixiangfeng, fangying.tommy, yanfei.xu

Hi Yanfei,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kvm/queue]
[also build test WARNING on kvm/next linus/master v6.19-rc2 next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yanfei-Xu/KVM-irqchip-KVM-Reduce-allocation-overhead-in-kvm_set_irq_routing/20251224-103451
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/20251224023201.381586-1-yanfei.xu%40bytedance.com
patch subject: [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing()
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251224/202512241858.vP31c8Cu-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251224/202512241858.vP31c8Cu-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/202512241858.vP31c8Cu-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kvm/../../../virt/kvm/irqchip.c:190:6: warning: variable 'r' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     190 |         if (!e)
         |             ^~
   arch/x86/kvm/../../../virt/kvm/irqchip.c:233:9: note: uninitialized use occurs here
     233 |         return r;
         |                ^
   arch/x86/kvm/../../../virt/kvm/irqchip.c:190:2: note: remove the 'if' if its condition is always false
     190 |         if (!e)
         |         ^~~~~~~
     191 |                 goto out;
         |                 ~~~~~~~~
   arch/x86/kvm/../../../virt/kvm/irqchip.c:176:7: note: initialize the variable 'r' to silence this warning
     176 |         int r;
         |              ^
         |               = 0
   1 warning generated.


vim +190 arch/x86/kvm/../../../virt/kvm/irqchip.c

   167	
   168	int kvm_set_irq_routing(struct kvm *kvm,
   169				const struct kvm_irq_routing_entry *ue,
   170				unsigned nr,
   171				unsigned flags)
   172	{
   173		struct kvm_irq_routing_table *new, *old;
   174		struct kvm_kernel_irq_routing_entry *e;
   175		u32 i, j, nr_rt_entries = 0;
   176		int r;
   177	
   178		for (i = 0; i < nr; ++i) {
   179			if (ue[i].gsi >= KVM_MAX_IRQ_ROUTES)
   180				return -EINVAL;
   181			nr_rt_entries = max(nr_rt_entries, ue[i].gsi);
   182		}
   183	
   184		nr_rt_entries += 1;
   185	
   186		new = kzalloc(struct_size(new, map, nr_rt_entries), GFP_KERNEL_ACCOUNT);
   187		if (!new)
   188			return -ENOMEM;
   189		e = kcalloc(nr, sizeof(*e), GFP_KERNEL_ACCOUNT);
 > 190		if (!e)
   191			goto out;
   192		new->entries_addr = e;
   193	
   194		new->nr_rt_entries = nr_rt_entries;
   195		for (i = 0; i < KVM_NR_IRQCHIPS; i++)
   196			for (j = 0; j < KVM_IRQCHIP_NUM_PINS; j++)
   197				new->chip[i][j] = -1;
   198	
   199		for (i = 0; i < nr; ++i) {
   200			r = -EINVAL;
   201			switch (ue->type) {
   202			case KVM_IRQ_ROUTING_MSI:
   203				if (ue->flags & ~KVM_MSI_VALID_DEVID)
   204					goto out;
   205				break;
   206			default:
   207				if (ue->flags)
   208					goto out;
   209				break;
   210			}
   211			r = setup_routing_entry(kvm, new, e + i, ue);
   212			if (r)
   213				goto out;
   214			++ue;
   215		}
   216	
   217		mutex_lock(&kvm->irq_lock);
   218		old = rcu_dereference_protected(kvm->irq_routing, 1);
   219		rcu_assign_pointer(kvm->irq_routing, new);
   220		kvm_irq_routing_update(kvm);
   221		kvm_arch_irq_routing_update(kvm);
   222		mutex_unlock(&kvm->irq_lock);
   223	
   224		synchronize_srcu_expedited(&kvm->irq_srcu);
   225	
   226		new = old;
   227		r = 0;
   228		goto out;
   229	
   230	out:
   231		free_irq_routing_table(new);
   232	
   233		return r;
   234	}
   235	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing()
       [not found] <20251224023201.381586-1-yanfei.xu@bytedance.com>
  2025-12-24 17:35 ` [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing() kernel test robot
@ 2025-12-25  6:04 ` kernel test robot
  2025-12-25  9:34 ` kernel test robot
  2 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-12-25  6:04 UTC (permalink / raw)
  To: Yanfei Xu, pbonzini
  Cc: llvm, oe-kbuild-all, kvm, caixiangfeng, fangying.tommy, yanfei.xu

Hi Yanfei,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kvm/queue]
[also build test WARNING on kvm/next linus/master v6.19-rc2 next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yanfei-Xu/KVM-irqchip-KVM-Reduce-allocation-overhead-in-kvm_set_irq_routing/20251224-103451
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/20251224023201.381586-1-yanfei.xu%40bytedance.com
patch subject: [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing()
config: x86_64-kexec (https://download.01.org/0day-ci/archive/20251225/202512251312.VbcflZDz-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251225/202512251312.VbcflZDz-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/202512251312.VbcflZDz-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/x86/kvm/../../../virt/kvm/irqchip.c:190:6: warning: variable 'r' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     190 |         if (!e)
         |             ^~
   arch/x86/kvm/../../../virt/kvm/irqchip.c:233:9: note: uninitialized use occurs here
     233 |         return r;
         |                ^
   arch/x86/kvm/../../../virt/kvm/irqchip.c:190:2: note: remove the 'if' if its condition is always false
     190 |         if (!e)
         |         ^~~~~~~
     191 |                 goto out;
         |                 ~~~~~~~~
   arch/x86/kvm/../../../virt/kvm/irqchip.c:176:7: note: initialize the variable 'r' to silence this warning
     176 |         int r;
         |              ^
         |               = 0
   1 warning generated.


vim +190 arch/x86/kvm/../../../virt/kvm/irqchip.c

   167	
   168	int kvm_set_irq_routing(struct kvm *kvm,
   169				const struct kvm_irq_routing_entry *ue,
   170				unsigned nr,
   171				unsigned flags)
   172	{
   173		struct kvm_irq_routing_table *new, *old;
   174		struct kvm_kernel_irq_routing_entry *e;
   175		u32 i, j, nr_rt_entries = 0;
   176		int r;
   177	
   178		for (i = 0; i < nr; ++i) {
   179			if (ue[i].gsi >= KVM_MAX_IRQ_ROUTES)
   180				return -EINVAL;
   181			nr_rt_entries = max(nr_rt_entries, ue[i].gsi);
   182		}
   183	
   184		nr_rt_entries += 1;
   185	
   186		new = kzalloc(struct_size(new, map, nr_rt_entries), GFP_KERNEL_ACCOUNT);
   187		if (!new)
   188			return -ENOMEM;
   189		e = kcalloc(nr, sizeof(*e), GFP_KERNEL_ACCOUNT);
 > 190		if (!e)
   191			goto out;
   192		new->entries_addr = e;
   193	
   194		new->nr_rt_entries = nr_rt_entries;
   195		for (i = 0; i < KVM_NR_IRQCHIPS; i++)
   196			for (j = 0; j < KVM_IRQCHIP_NUM_PINS; j++)
   197				new->chip[i][j] = -1;
   198	
   199		for (i = 0; i < nr; ++i) {
   200			r = -EINVAL;
   201			switch (ue->type) {
   202			case KVM_IRQ_ROUTING_MSI:
   203				if (ue->flags & ~KVM_MSI_VALID_DEVID)
   204					goto out;
   205				break;
   206			default:
   207				if (ue->flags)
   208					goto out;
   209				break;
   210			}
   211			r = setup_routing_entry(kvm, new, e + i, ue);
   212			if (r)
   213				goto out;
   214			++ue;
   215		}
   216	
   217		mutex_lock(&kvm->irq_lock);
   218		old = rcu_dereference_protected(kvm->irq_routing, 1);
   219		rcu_assign_pointer(kvm->irq_routing, new);
   220		kvm_irq_routing_update(kvm);
   221		kvm_arch_irq_routing_update(kvm);
   222		mutex_unlock(&kvm->irq_lock);
   223	
   224		synchronize_srcu_expedited(&kvm->irq_srcu);
   225	
   226		new = old;
   227		r = 0;
   228		goto out;
   229	
   230	out:
   231		free_irq_routing_table(new);
   232	
   233		return r;
   234	}
   235	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing()
       [not found] <20251224023201.381586-1-yanfei.xu@bytedance.com>
  2025-12-24 17:35 ` [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing() kernel test robot
  2025-12-25  6:04 ` kernel test robot
@ 2025-12-25  9:34 ` kernel test robot
  2 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-12-25  9:34 UTC (permalink / raw)
  To: Yanfei Xu, pbonzini
  Cc: llvm, oe-kbuild-all, kvm, caixiangfeng, fangying.tommy, yanfei.xu

Hi Yanfei,

kernel test robot noticed the following build warnings:

[auto build test WARNING on kvm/queue]
[also build test WARNING on kvm/next linus/master v6.19-rc2 next-20251219]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Yanfei-Xu/KVM-irqchip-KVM-Reduce-allocation-overhead-in-kvm_set_irq_routing/20251224-103451
base:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
patch link:    https://lore.kernel.org/r/20251224023201.381586-1-yanfei.xu%40bytedance.com
patch subject: [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing()
config: loongarch-defconfig (https://download.01.org/0day-ci/archive/20251225/202512251741.UOsoJoam-lkp@intel.com/config)
compiler: clang version 19.1.7 (https://github.com/llvm/llvm-project cd708029e0b2869e80abe31ddb175f7c35361f90)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251225/202512251741.UOsoJoam-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/202512251741.UOsoJoam-lkp@intel.com/

All warnings (new ones prefixed by >>):

>> arch/loongarch/kvm/../../../virt/kvm/irqchip.c:190:6: warning: variable 'r' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
     190 |         if (!e)
         |             ^~
   arch/loongarch/kvm/../../../virt/kvm/irqchip.c:233:9: note: uninitialized use occurs here
     233 |         return r;
         |                ^
   arch/loongarch/kvm/../../../virt/kvm/irqchip.c:190:2: note: remove the 'if' if its condition is always false
     190 |         if (!e)
         |         ^~~~~~~
     191 |                 goto out;
         |                 ~~~~~~~~
   arch/loongarch/kvm/../../../virt/kvm/irqchip.c:176:7: note: initialize the variable 'r' to silence this warning
     176 |         int r;
         |              ^
         |               = 0
   1 warning generated.


vim +190 arch/loongarch/kvm/../../../virt/kvm/irqchip.c

   167	
   168	int kvm_set_irq_routing(struct kvm *kvm,
   169				const struct kvm_irq_routing_entry *ue,
   170				unsigned nr,
   171				unsigned flags)
   172	{
   173		struct kvm_irq_routing_table *new, *old;
   174		struct kvm_kernel_irq_routing_entry *e;
   175		u32 i, j, nr_rt_entries = 0;
   176		int r;
   177	
   178		for (i = 0; i < nr; ++i) {
   179			if (ue[i].gsi >= KVM_MAX_IRQ_ROUTES)
   180				return -EINVAL;
   181			nr_rt_entries = max(nr_rt_entries, ue[i].gsi);
   182		}
   183	
   184		nr_rt_entries += 1;
   185	
   186		new = kzalloc(struct_size(new, map, nr_rt_entries), GFP_KERNEL_ACCOUNT);
   187		if (!new)
   188			return -ENOMEM;
   189		e = kcalloc(nr, sizeof(*e), GFP_KERNEL_ACCOUNT);
 > 190		if (!e)
   191			goto out;
   192		new->entries_addr = e;
   193	
   194		new->nr_rt_entries = nr_rt_entries;
   195		for (i = 0; i < KVM_NR_IRQCHIPS; i++)
   196			for (j = 0; j < KVM_IRQCHIP_NUM_PINS; j++)
   197				new->chip[i][j] = -1;
   198	
   199		for (i = 0; i < nr; ++i) {
   200			r = -EINVAL;
   201			switch (ue->type) {
   202			case KVM_IRQ_ROUTING_MSI:
   203				if (ue->flags & ~KVM_MSI_VALID_DEVID)
   204					goto out;
   205				break;
   206			default:
   207				if (ue->flags)
   208					goto out;
   209				break;
   210			}
   211			r = setup_routing_entry(kvm, new, e + i, ue);
   212			if (r)
   213				goto out;
   214			++ue;
   215		}
   216	
   217		mutex_lock(&kvm->irq_lock);
   218		old = rcu_dereference_protected(kvm->irq_routing, 1);
   219		rcu_assign_pointer(kvm->irq_routing, new);
   220		kvm_irq_routing_update(kvm);
   221		kvm_arch_irq_routing_update(kvm);
   222		mutex_unlock(&kvm->irq_lock);
   223	
   224		synchronize_srcu_expedited(&kvm->irq_srcu);
   225	
   226		new = old;
   227		r = 0;
   228		goto out;
   229	
   230	out:
   231		free_irq_routing_table(new);
   232	
   233		return r;
   234	}
   235	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-25  9:35 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20251224023201.381586-1-yanfei.xu@bytedance.com>
2025-12-24 17:35 ` [PATCH] KVM: irqchip: KVM: Reduce allocation overhead in kvm_set_irq_routing() kernel test robot
2025-12-25  6:04 ` kernel test robot
2025-12-25  9:34 ` kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox