All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: kbuild@lists.01.org
Subject: [kas:kvm-unmapped-memfd-secret 9/11] arch/s390/kvm/../../../virt/kvm/kvm_main.c:2710:23: warning: variable 'end' set but not used
Date: Fri, 08 Jan 2021 18:46:32 +0800	[thread overview]
Message-ID: <202101081826.8Deav4kv-lkp@intel.com> (raw)

[-- 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 --]

             reply	other threads:[~2021-01-08 10:46 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-08 10:46 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202101081826.8Deav4kv-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kbuild@lists.01.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.