All of lore.kernel.org
 help / color / mirror / Atom feed
* [intel-tdx:kvm-upstream-next 196/273] arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'
@ 2023-11-17  7:34 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-11-17  7:34 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Sagi Shahar <sagis@google.com>
CC: Isaku Yamahata <isaku.yamahata@intel.com>

tree:   https://github.com/intel/tdx.git kvm-upstream-next
head:   90fec84219b5d2bf13e61f02777f6a44ab755bc4
commit: bf2a53c6d4d7151ace11879b20cacf6b07bdedcb [196/273] KVM: SEV: Refactor common code out of sev_vm_move_enc_context_from
:::::: branch date: 34 hours ago
:::::: commit date: 34 hours ago
config: x86_64-randconfig-161-20231117 (https://download.01.org/0day-ci/archive/20231117/202311171500.e2f5AH17-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce: (https://download.01.org/0day-ci/archive/20231117/202311171500.e2f5AH17-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202311171500.e2f5AH17-lkp@intel.com/

New smatch warnings:
arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'

Old smatch warnings:
arch/x86/kvm/x86.c:5700 kvm_arch_tsc_set_attr() warn: check for integer overflow 'offset'
arch/x86/kvm/x86.c:5742 kvm_vcpu_ioctl_device_attr() error: uninitialized symbol 'r'.
arch/x86/kvm/x86.c:7902 emulator_read_write() warn: missing error code? 'rc'
arch/x86/kvm/x86.c:9068 x86_emulate_instruction() warn: missing error code? 'r'
arch/x86/include/asm/kvm-x86-ops.h:17 kvm_ops_update() warn: inconsistent indenting

vim +/ret +14007 arch/x86/kvm/x86.c

bf2a53c6d4d715 Sagi Shahar 2023-04-07  13982  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13983  int pre_move_enc_context_from(struct kvm *dst_kvm, struct kvm *src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13984  			      atomic_t *dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13985  			      atomic_t *src_migration_in_progress)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13986  {
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13987  	struct kvm_vcpu *src_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13988  	unsigned long i;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13989  	int ret = -EINVAL;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13990  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13991  	ret = lock_two_vms_for_migration(dst_kvm, src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13992  					 dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13993  					 src_migration_in_progress);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13994  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13995  		return ret;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13996  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13997  	ret = lock_vcpus_for_migration(dst_kvm, MIGRATION_TARGET);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13998  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13999  		goto unlock_vms;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14000  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14001  	ret = lock_vcpus_for_migration(src_kvm, MIGRATION_SOURCE);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14002  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14003  		goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14004  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14005  	if (atomic_read(&dst_kvm->online_vcpus) !=
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14006  	    atomic_read(&src_kvm->online_vcpus))
bf2a53c6d4d715 Sagi Shahar 2023-04-07 @14007  		goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14008  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14009  	kvm_for_each_vcpu(i, src_vcpu, src_kvm) {
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14010  		if (!src_vcpu->arch.guest_state_protected)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14011  			goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14012  	}
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14013  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14014  	return 0;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14015  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14016  unlock_dst_vcpu:
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14017  	unlock_vcpus_for_migration(dst_kvm);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14018  unlock_vms:
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14019  	unlock_two_vms_for_migration(dst_kvm, src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14020  				     dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14021  				     src_migration_in_progress);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14022  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14023  	return ret;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14024  }
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14025  EXPORT_SYMBOL_GPL(pre_move_enc_context_from);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14026  

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

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

* [intel-tdx:kvm-upstream-next 196/273] arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'
@ 2023-11-17 12:42 kernel test robot
  0 siblings, 0 replies; 4+ messages in thread
From: kernel test robot @ 2023-11-17 12:42 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp, Dan Carpenter

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
TO: Sagi Shahar <sagis@google.com>
CC: Isaku Yamahata <isaku.yamahata@intel.com>

tree:   https://github.com/intel/tdx.git kvm-upstream-next
head:   90fec84219b5d2bf13e61f02777f6a44ab755bc4
commit: bf2a53c6d4d7151ace11879b20cacf6b07bdedcb [196/273] KVM: SEV: Refactor common code out of sev_vm_move_enc_context_from
:::::: branch date: 2 days ago
:::::: commit date: 2 days ago
config: x86_64-randconfig-161-20231117 (https://download.01.org/0day-ci/archive/20231117/202311171944.g4l2vVTQ-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce: (https://download.01.org/0day-ci/archive/20231117/202311171944.g4l2vVTQ-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202311171944.g4l2vVTQ-lkp@intel.com/

New smatch warnings:
arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'

Old smatch warnings:
arch/x86/kvm/x86.c:5700 kvm_arch_tsc_set_attr() warn: check for integer overflow 'offset'
arch/x86/kvm/x86.c:5742 kvm_vcpu_ioctl_device_attr() error: uninitialized symbol 'r'.
arch/x86/kvm/x86.c:7902 emulator_read_write() warn: missing error code? 'rc'
arch/x86/kvm/x86.c:9068 x86_emulate_instruction() warn: missing error code? 'r'
arch/x86/include/asm/kvm-x86-ops.h:17 kvm_ops_update() warn: inconsistent indenting

vim +/ret +14007 arch/x86/kvm/x86.c

bf2a53c6d4d715 Sagi Shahar 2023-04-07  13982  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13983  int pre_move_enc_context_from(struct kvm *dst_kvm, struct kvm *src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13984  			      atomic_t *dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13985  			      atomic_t *src_migration_in_progress)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13986  {
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13987  	struct kvm_vcpu *src_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13988  	unsigned long i;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13989  	int ret = -EINVAL;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13990  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13991  	ret = lock_two_vms_for_migration(dst_kvm, src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13992  					 dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13993  					 src_migration_in_progress);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13994  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13995  		return ret;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13996  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13997  	ret = lock_vcpus_for_migration(dst_kvm, MIGRATION_TARGET);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13998  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13999  		goto unlock_vms;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14000  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14001  	ret = lock_vcpus_for_migration(src_kvm, MIGRATION_SOURCE);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14002  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14003  		goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14004  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14005  	if (atomic_read(&dst_kvm->online_vcpus) !=
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14006  	    atomic_read(&src_kvm->online_vcpus))
bf2a53c6d4d715 Sagi Shahar 2023-04-07 @14007  		goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14008  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14009  	kvm_for_each_vcpu(i, src_vcpu, src_kvm) {
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14010  		if (!src_vcpu->arch.guest_state_protected)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14011  			goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14012  	}
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14013  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14014  	return 0;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14015  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14016  unlock_dst_vcpu:
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14017  	unlock_vcpus_for_migration(dst_kvm);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14018  unlock_vms:
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14019  	unlock_two_vms_for_migration(dst_kvm, src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14020  				     dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14021  				     src_migration_in_progress);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14022  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14023  	return ret;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14024  }
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14025  EXPORT_SYMBOL_GPL(pre_move_enc_context_from);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14026  

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

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

* [intel-tdx:kvm-upstream-next 196/273] arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'
@ 2023-11-20 12:59 Dan Carpenter
  2023-11-20 19:47 ` Yamahata, Isaku
  0 siblings, 1 reply; 4+ messages in thread
From: Dan Carpenter @ 2023-11-20 12:59 UTC (permalink / raw)
  To: oe-kbuild, Sagi Shahar; +Cc: lkp, oe-kbuild-all, Isaku Yamahata

tree:   https://github.com/intel/tdx.git kvm-upstream-next
head:   90fec84219b5d2bf13e61f02777f6a44ab755bc4
commit: bf2a53c6d4d7151ace11879b20cacf6b07bdedcb [196/273] KVM: SEV: Refactor common code out of sev_vm_move_enc_context_from
config: x86_64-randconfig-161-20231117 (https://download.01.org/0day-ci/archive/20231117/202311171500.e2f5AH17-lkp@intel.com/config)
compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
reproduce: (https://download.01.org/0day-ci/archive/20231117/202311171500.e2f5AH17-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>
| Reported-by: Dan Carpenter <error27@gmail.com>
| Closes: https://lore.kernel.org/r/202311171500.e2f5AH17-lkp@intel.com/

New smatch warnings:
arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'

vim +/ret +14007 arch/x86/kvm/x86.c

bf2a53c6d4d715 Sagi Shahar 2023-04-07  13983  int pre_move_enc_context_from(struct kvm *dst_kvm, struct kvm *src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13984  			      atomic_t *dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13985  			      atomic_t *src_migration_in_progress)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13986  {
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13987  	struct kvm_vcpu *src_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13988  	unsigned long i;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13989  	int ret = -EINVAL;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13990  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13991  	ret = lock_two_vms_for_migration(dst_kvm, src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13992  					 dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13993  					 src_migration_in_progress);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13994  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13995  		return ret;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13996  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13997  	ret = lock_vcpus_for_migration(dst_kvm, MIGRATION_TARGET);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13998  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  13999  		goto unlock_vms;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14000  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14001  	ret = lock_vcpus_for_migration(src_kvm, MIGRATION_SOURCE);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14002  	if (ret)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14003  		goto unlock_dst_vcpu;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14004  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14005  	if (atomic_read(&dst_kvm->online_vcpus) !=
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14006  	    atomic_read(&src_kvm->online_vcpus))
bf2a53c6d4d715 Sagi Shahar 2023-04-07 @14007  		goto unlock_dst_vcpu;

Missing error code?

bf2a53c6d4d715 Sagi Shahar 2023-04-07  14008  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14009  	kvm_for_each_vcpu(i, src_vcpu, src_kvm) {
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14010  		if (!src_vcpu->arch.guest_state_protected)
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14011  			goto unlock_dst_vcpu;

Here too.

bf2a53c6d4d715 Sagi Shahar 2023-04-07  14012  	}
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14013  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14014  	return 0;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14015  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14016  unlock_dst_vcpu:
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14017  	unlock_vcpus_for_migration(dst_kvm);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14018  unlock_vms:
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14019  	unlock_two_vms_for_migration(dst_kvm, src_kvm,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14020  				     dst_migration_in_progress,
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14021  				     src_migration_in_progress);
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14022  
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14023  	return ret;
bf2a53c6d4d715 Sagi Shahar 2023-04-07  14024  }

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


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

* RE: [intel-tdx:kvm-upstream-next 196/273] arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'
  2023-11-20 12:59 Dan Carpenter
@ 2023-11-20 19:47 ` Yamahata, Isaku
  0 siblings, 0 replies; 4+ messages in thread
From: Yamahata, Isaku @ 2023-11-20 19:47 UTC (permalink / raw)
  To: Dan Carpenter, oe-kbuild@lists.linux.dev, Sagi Shahar
  Cc: lkp, oe-kbuild-all@lists.linux.dev, Yamahata, Isaku

> tree:   https://github.com/intel/tdx.git kvm-upstream-next
> head:   90fec84219b5d2bf13e61f02777f6a44ab755bc4
> commit: bf2a53c6d4d7151ace11879b20cacf6b07bdedcb [196/273] KVM: SEV: Refactor common code out of
> sev_vm_move_enc_context_from
> config: x86_64-randconfig-161-20231117 (https://download.01.org/0day-ci/archive/20231117/202311171500.e2f5AH17-
> lkp@intel.com/config)
> compiler: gcc-7 (Ubuntu 7.5.0-6ubuntu2) 7.5.0
> reproduce: (https://download.01.org/0day-ci/archive/20231117/202311171500.e2f5AH17-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>
> | Reported-by: Dan Carpenter <error27@gmail.com>
> | Closes: https://lore.kernel.org/r/202311171500.e2f5AH17-lkp@intel.com/
> 
> New smatch warnings:
> arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret'
> 
> vim +/ret +14007 arch/x86/kvm/x86.c
> 
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13983  int pre_move_enc_context_from(struct kvm *dst_kvm, struct kvm *src_kvm,
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13984  			      atomic_t *dst_migration_in_progress,
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13985  			      atomic_t *src_migration_in_progress)
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13986  {
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13987  	struct kvm_vcpu *src_vcpu;
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13988  	unsigned long i;
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13989  	int ret = -EINVAL;
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13990
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13991  	ret = lock_two_vms_for_migration(dst_kvm, src_kvm,
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13992  					 dst_migration_in_progress,
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13993  					 src_migration_in_progress);
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13994  	if (ret)
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13995  		return ret;
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13996
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13997  	ret = lock_vcpus_for_migration(dst_kvm, MIGRATION_TARGET);
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13998  	if (ret)
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  13999  		goto unlock_vms;
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14000
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14001  	ret = lock_vcpus_for_migration(src_kvm, MIGRATION_SOURCE);
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14002  	if (ret)
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14003  		goto unlock_dst_vcpu;
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14004
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14005  	if (atomic_read(&dst_kvm->online_vcpus) !=
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14006  	    atomic_read(&src_kvm->online_vcpus))
> bf2a53c6d4d715 Sagi Shahar 2023-04-07 @14007  		goto unlock_dst_vcpu;
> 
> Missing error code?
> 
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14008
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14009  	kvm_for_each_vcpu(i, src_vcpu, src_kvm) {
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14010  		if (!src_vcpu->arch.guest_state_protected)
> bf2a53c6d4d715 Sagi Shahar 2023-04-07  14011  			goto unlock_dst_vcpu;
> 
> Here too.

Yes. I'll fix the patch on the next respin in my tree.
Sagi, you'd like to fix your own tree.

diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
index 71a50d905ecf..97f406051396 100644
--- a/arch/x86/kvm/x86.c
+++ b/arch/x86/kvm/x86.c
@@ -14147,7 +14147,7 @@ int pre_move_enc_context_from(struct kvm *dst_kvm, struct kvm *src_kvm,
 {
        struct kvm_vcpu *src_vcpu;
        unsigned long i;
-       int ret = -EINVAL;
+       int ret;
 
        ret = lock_two_vms_for_migration(dst_kvm, src_kvm,
                                         dst_migration_in_progress,
@@ -14164,12 +14164,16 @@ int pre_move_enc_context_from(struct kvm *dst_kvm, struct kvm *src_kvm,
                goto unlock_dst_vcpu;
 
        if (atomic_read(&dst_kvm->online_vcpus) !=
-           atomic_read(&src_kvm->online_vcpus))
+           atomic_read(&src_kvm->online_vcpus)) {
+               ret = -EINVAL;
                goto unlock_dst_vcpu;
+       }
 
        kvm_for_each_vcpu(i, src_vcpu, src_kvm) {
-               if (!src_vcpu->arch.guest_state_protected)
+               if (!src_vcpu->arch.guest_state_protected) {
+                       ret = -EINVAL;
                        goto unlock_dst_vcpu;
+               }
        }
 
        return 0;

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

end of thread, other threads:[~2023-11-20 19:47 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-17  7:34 [intel-tdx:kvm-upstream-next 196/273] arch/x86/kvm/x86.c:14007 pre_move_enc_context_from() warn: missing error code 'ret' kernel test robot
  -- strict thread matches above, loose matches on Subject: below --
2023-11-17 12:42 kernel test robot
2023-11-20 12:59 Dan Carpenter
2023-11-20 19:47 ` Yamahata, Isaku

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.