All of lore.kernel.org
 help / color / mirror / Atom feed
* [kas:kvm-unmapped-memfd-secret 9/11] arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used
@ 2021-01-08 11:00 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-01-08 11:00 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5476 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git  kvm-unmapped-memfd-secret
head:   ee93fab5627b827e7893a071dc59b26782eb8b28
commit: d922017493326641248b7c74b713e33f14bc8c5a [9/11] KVM: Handle secretmem
config: s390-randconfig-s031-20210108 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross  -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git/commit/?id=d922017493326641248b7c74b713e33f14bc8c5a 
        git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git 
        git fetch --no-tags kas kvm-unmapped-memfd-secret
        git checkout d922017493326641248b7c74b713e33f14bc8c5a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/s390/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_share_memory':
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used [-Wunused-but-set-variable]
    2710 |  unsigned long start, end;
         |                       ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SKB_EXTENSIONS
   Depends on NET
   Selected by
   - KCOV && ARCH_HAS_KCOV && (CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS


"sparse warnings: (new ones prefixed by >>)"
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *hva @@     got void [noderef] __iomem * @@
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse:     expected void *hva
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse:     got void [noderef] __iomem *
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *hva @@
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse:     expected void volatile [noderef] __iomem *addr
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse:     got void *hva

vim +/end +2710 arch/s390/kvm/../../../virt/kvm/kvm_main.c

d922017493326641 Kirill A. Shutemov 2021-01-04  2707  int kvm_share_memory(struct kvm *kvm, unsigned long gfn, unsigned long npages)
d922017493326641 Kirill A. Shutemov 2021-01-04  2708  {
d922017493326641 Kirill A. Shutemov 2021-01-04  2709  	struct kvm_memory_slot *memslot;
d922017493326641 Kirill A. Shutemov 2021-01-04 @2710  	unsigned long start, end;
d922017493326641 Kirill A. Shutemov 2021-01-04  2711  	gfn_t numpages;
d922017493326641 Kirill A. Shutemov 2021-01-04  2712  	unsigned long ret;
d922017493326641 Kirill A. Shutemov 2021-01-04  2713  
d922017493326641 Kirill A. Shutemov 2021-01-04  2714  	if (!npages)
d922017493326641 Kirill A. Shutemov 2021-01-04  2715  		return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2716  
d922017493326641 Kirill A. Shutemov 2021-01-04  2717  	memslot = gfn_to_memslot(kvm, gfn);
d922017493326641 Kirill A. Shutemov 2021-01-04  2718  	/* Not backed by memory. It's okay. */
d922017493326641 Kirill A. Shutemov 2021-01-04  2719  	if (!memslot)
d922017493326641 Kirill A. Shutemov 2021-01-04  2720  		return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2721  
d922017493326641 Kirill A. Shutemov 2021-01-04  2722  	start = gfn_to_hva_many(memslot, gfn, &numpages);
d922017493326641 Kirill A. Shutemov 2021-01-04  2723  	if (kvm_is_error_hva(start))
d922017493326641 Kirill A. Shutemov 2021-01-04  2724  		return -KVM_EINVAL;
d922017493326641 Kirill A. Shutemov 2021-01-04  2725  	end = start + npages * PAGE_SIZE;
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Assignment is never used.

d922017493326641 Kirill A. Shutemov 2021-01-04  2726  
d922017493326641 Kirill A. Shutemov 2021-01-04  2727  	/* XXX: Share range across memory slots? */
d922017493326641 Kirill A. Shutemov 2021-01-04  2728  	if (WARN_ON(numpages < npages))
d922017493326641 Kirill A. Shutemov 2021-01-04  2729  		return -KVM_EINVAL;
d922017493326641 Kirill A. Shutemov 2021-01-04  2730  
d922017493326641 Kirill A. Shutemov 2021-01-04  2731  	ret = vm_mmap(NULL, start, npages * PAGE_SIZE, PROT_READ | PROT_WRITE,
d922017493326641 Kirill A. Shutemov 2021-01-04  2732  		      MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0);
d922017493326641 Kirill A. Shutemov 2021-01-04  2733  	if (ret != start)
d922017493326641 Kirill A. Shutemov 2021-01-04  2734  		return KVM_EFAULT;
d922017493326641 Kirill A. Shutemov 2021-01-04  2735  
d922017493326641 Kirill A. Shutemov 2021-01-04  2736  	return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2737  }

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

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28455 bytes --]

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

* [kbuild] [kas:kvm-unmapped-memfd-secret 9/11] arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used
@ 2021-01-08 11:00 ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2021-01-08 11:00 UTC (permalink / raw)
  To: kbuild-all

[-- Attachment #1: Type: text/plain, Size: 5476 bytes --]

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git  kvm-unmapped-memfd-secret
head:   ee93fab5627b827e7893a071dc59b26782eb8b28
commit: d922017493326641248b7c74b713e33f14bc8c5a [9/11] KVM: Handle secretmem
config: s390-randconfig-s031-20210108 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross  -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git/commit/?id=d922017493326641248b7c74b713e33f14bc8c5a 
        git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git 
        git fetch --no-tags kas kvm-unmapped-memfd-secret
        git checkout d922017493326641248b7c74b713e33f14bc8c5a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/s390/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_share_memory':
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used [-Wunused-but-set-variable]
    2710 |  unsigned long start, end;
         |                       ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SKB_EXTENSIONS
   Depends on NET
   Selected by
   - KCOV && ARCH_HAS_KCOV && (CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS


"sparse warnings: (new ones prefixed by >>)"
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *hva @@     got void [noderef] __iomem * @@
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse:     expected void *hva
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse:     got void [noderef] __iomem *
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *hva @@
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse:     expected void volatile [noderef] __iomem *addr
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse:     got void *hva

vim +/end +2710 arch/s390/kvm/../../../virt/kvm/kvm_main.c

d922017493326641 Kirill A. Shutemov 2021-01-04  2707  int kvm_share_memory(struct kvm *kvm, unsigned long gfn, unsigned long npages)
d922017493326641 Kirill A. Shutemov 2021-01-04  2708  {
d922017493326641 Kirill A. Shutemov 2021-01-04  2709  	struct kvm_memory_slot *memslot;
d922017493326641 Kirill A. Shutemov 2021-01-04 @2710  	unsigned long start, end;
d922017493326641 Kirill A. Shutemov 2021-01-04  2711  	gfn_t numpages;
d922017493326641 Kirill A. Shutemov 2021-01-04  2712  	unsigned long ret;
d922017493326641 Kirill A. Shutemov 2021-01-04  2713  
d922017493326641 Kirill A. Shutemov 2021-01-04  2714  	if (!npages)
d922017493326641 Kirill A. Shutemov 2021-01-04  2715  		return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2716  
d922017493326641 Kirill A. Shutemov 2021-01-04  2717  	memslot = gfn_to_memslot(kvm, gfn);
d922017493326641 Kirill A. Shutemov 2021-01-04  2718  	/* Not backed by memory. It's okay. */
d922017493326641 Kirill A. Shutemov 2021-01-04  2719  	if (!memslot)
d922017493326641 Kirill A. Shutemov 2021-01-04  2720  		return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2721  
d922017493326641 Kirill A. Shutemov 2021-01-04  2722  	start = gfn_to_hva_many(memslot, gfn, &numpages);
d922017493326641 Kirill A. Shutemov 2021-01-04  2723  	if (kvm_is_error_hva(start))
d922017493326641 Kirill A. Shutemov 2021-01-04  2724  		return -KVM_EINVAL;
d922017493326641 Kirill A. Shutemov 2021-01-04  2725  	end = start + npages * PAGE_SIZE;
                                                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Assignment is never used.

d922017493326641 Kirill A. Shutemov 2021-01-04  2726  
d922017493326641 Kirill A. Shutemov 2021-01-04  2727  	/* XXX: Share range across memory slots? */
d922017493326641 Kirill A. Shutemov 2021-01-04  2728  	if (WARN_ON(numpages < npages))
d922017493326641 Kirill A. Shutemov 2021-01-04  2729  		return -KVM_EINVAL;
d922017493326641 Kirill A. Shutemov 2021-01-04  2730  
d922017493326641 Kirill A. Shutemov 2021-01-04  2731  	ret = vm_mmap(NULL, start, npages * PAGE_SIZE, PROT_READ | PROT_WRITE,
d922017493326641 Kirill A. Shutemov 2021-01-04  2732  		      MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0);
d922017493326641 Kirill A. Shutemov 2021-01-04  2733  	if (ret != start)
d922017493326641 Kirill A. Shutemov 2021-01-04  2734  		return KVM_EFAULT;
d922017493326641 Kirill A. Shutemov 2021-01-04  2735  
d922017493326641 Kirill A. Shutemov 2021-01-04  2736  	return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2737  }

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

_______________________________________________
kbuild mailing list -- kbuild(a)lists.01.org
To unsubscribe send an email to kbuild-leave@lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28455 bytes --]

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

* [kas:kvm-unmapped-memfd-secret 9/11] arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used
@ 2021-01-08 10:46 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2021-01-08 10:46 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 5463 bytes --]

CC: kbuild-all(a)lists.01.org
TO: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git kvm-unmapped-memfd-secret
head:   ee93fab5627b827e7893a071dc59b26782eb8b28
commit: d922017493326641248b7c74b713e33f14bc8c5a [9/11] KVM: Handle secretmem
:::::: branch date: 4 days ago
:::::: commit date: 4 days ago
config: s390-randconfig-s031-20210108 (attached as .config)
compiler: s390-linux-gcc (GCC) 9.3.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-208-g46a52ca4-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git/commit/?id=d922017493326641248b7c74b713e33f14bc8c5a
        git remote add kas https://git.kernel.org/pub/scm/linux/kernel/git/kas/linux.git
        git fetch --no-tags kas kvm-unmapped-memfd-secret
        git checkout d922017493326641248b7c74b713e33f14bc8c5a
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-9.3.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=s390 

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>

All warnings (new ones prefixed by >>):

   arch/s390/kvm/../../../virt/kvm/kvm_main.c: In function 'kvm_share_memory':
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used [-Wunused-but-set-variable]
    2710 |  unsigned long start, end;
         |                       ^~~

Kconfig warnings: (for reference only)
   WARNING: unmet direct dependencies detected for SKB_EXTENSIONS
   Depends on NET
   Selected by
   - KCOV && ARCH_HAS_KCOV && (CC_HAS_SANCOV_TRACE_PC || GCC_PLUGINS


"sparse warnings: (new ones prefixed by >>)"
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void *hva @@     got void [noderef] __iomem * @@
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse:     expected void *hva
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2188:21: sparse:     got void [noderef] __iomem *
>> arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void volatile [noderef] __iomem *addr @@     got void *hva @@
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse:     expected void volatile [noderef] __iomem *addr
   arch/s390/kvm/../../../virt/kvm/kvm_main.c:2242:28: sparse:     got void *hva

vim +/end +2710 arch/s390/kvm/../../../virt/kvm/kvm_main.c

8e73485c7959fd25 Paolo Bonzini      2015-05-17  2706  
d922017493326641 Kirill A. Shutemov 2021-01-04  2707  int kvm_share_memory(struct kvm *kvm, unsigned long gfn, unsigned long npages)
d922017493326641 Kirill A. Shutemov 2021-01-04  2708  {
d922017493326641 Kirill A. Shutemov 2021-01-04  2709  	struct kvm_memory_slot *memslot;
d922017493326641 Kirill A. Shutemov 2021-01-04 @2710  	unsigned long start, end;
d922017493326641 Kirill A. Shutemov 2021-01-04  2711  	gfn_t numpages;
d922017493326641 Kirill A. Shutemov 2021-01-04  2712  	unsigned long ret;
d922017493326641 Kirill A. Shutemov 2021-01-04  2713  
d922017493326641 Kirill A. Shutemov 2021-01-04  2714  	if (!npages)
d922017493326641 Kirill A. Shutemov 2021-01-04  2715  		return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2716  
d922017493326641 Kirill A. Shutemov 2021-01-04  2717  	memslot = gfn_to_memslot(kvm, gfn);
d922017493326641 Kirill A. Shutemov 2021-01-04  2718  	/* Not backed by memory. It's okay. */
d922017493326641 Kirill A. Shutemov 2021-01-04  2719  	if (!memslot)
d922017493326641 Kirill A. Shutemov 2021-01-04  2720  		return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2721  
d922017493326641 Kirill A. Shutemov 2021-01-04  2722  	start = gfn_to_hva_many(memslot, gfn, &numpages);
d922017493326641 Kirill A. Shutemov 2021-01-04  2723  	if (kvm_is_error_hva(start))
d922017493326641 Kirill A. Shutemov 2021-01-04  2724  		return -KVM_EINVAL;
d922017493326641 Kirill A. Shutemov 2021-01-04  2725  	end = start + npages * PAGE_SIZE;
d922017493326641 Kirill A. Shutemov 2021-01-04  2726  
d922017493326641 Kirill A. Shutemov 2021-01-04  2727  	/* XXX: Share range across memory slots? */
d922017493326641 Kirill A. Shutemov 2021-01-04  2728  	if (WARN_ON(numpages < npages))
d922017493326641 Kirill A. Shutemov 2021-01-04  2729  		return -KVM_EINVAL;
d922017493326641 Kirill A. Shutemov 2021-01-04  2730  
d922017493326641 Kirill A. Shutemov 2021-01-04  2731  	ret = vm_mmap(NULL, start, npages * PAGE_SIZE, PROT_READ | PROT_WRITE,
d922017493326641 Kirill A. Shutemov 2021-01-04  2732  		      MAP_ANONYMOUS | MAP_PRIVATE | MAP_FIXED, 0);
d922017493326641 Kirill A. Shutemov 2021-01-04  2733  	if (ret != start)
d922017493326641 Kirill A. Shutemov 2021-01-04  2734  		return KVM_EFAULT;
d922017493326641 Kirill A. Shutemov 2021-01-04  2735  
d922017493326641 Kirill A. Shutemov 2021-01-04  2736  	return 0;
d922017493326641 Kirill A. Shutemov 2021-01-04  2737  }
d922017493326641 Kirill A. Shutemov 2021-01-04  2738  

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

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 28455 bytes --]

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

end of thread, other threads:[~2021-01-08 11:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-08 11:00 [kas:kvm-unmapped-memfd-secret 9/11] arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used Dan Carpenter
2021-01-08 11:00 ` [kbuild] " Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2021-01-08 10:46 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.