mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Joerg Roedel <jroedel@suse.de>
Cc: kbuild-all@lists.01.org, linux-kernel@vger.kernel.org,
	Paolo Bonzini <pbonzini@redhat.com>
Subject: arch/x86/kvm/svm/sev.c:672:60: sparse: sparse: dereference of noderef expression
Date: Sun, 28 Feb 2021 01:53:44 +0800	[thread overview]
Message-ID: <202102280143.joh5OcJE-lkp@intel.com> (raw)

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

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   3fb6d0e00efc958d01c2f109c8453033a2d96796
commit: eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5 KVM: SVM: Move SEV code to separate file
date:   11 months ago
config: x86_64-randconfig-s022-20210228 (attached as .config)
compiler: gcc-9 (Debian 9.3.0-15) 9.3.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.3-241-geaceeafa-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5
        git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
        git fetch --no-tags linus master
        git checkout eaf78265a4ab33935d3a0f1407ce4a91aac4d4d5
        # save the attached .config to linux build tree
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 

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


"sparse warnings: (new ones prefixed by >>)"
   arch/x86/kvm/svm/sev.c:360:17: sparse: sparse: undefined identifier 'release_pages'
   arch/x86/kvm/svm/sev.c:371:9: sparse: sparse: undefined identifier 'release_pages'
>> arch/x86/kvm/svm/sev.c:672:60: sparse: sparse: dereference of noderef expression
>> arch/x86/kvm/svm/sev.c:672:60: sparse: sparse: dereference of noderef expression
   arch/x86/kvm/svm/sev.c:695:14: sparse: sparse: dereference of noderef expression
   arch/x86/kvm/svm/sev.c:701:59: sparse: sparse: dereference of noderef expression
   arch/x86/kvm/svm/sev.c:701:59: sparse: sparse: dereference of noderef expression
   arch/x86/kvm/svm/sev.c:715:14: sparse: sparse: dereference of noderef expression
   arch/x86/kvm/svm/sev.c:740:70: sparse: sparse: dereference of noderef expression
   arch/x86/kvm/svm/sev.c:740:70: sparse: sparse: dereference of noderef expression

vim +672 arch/x86/kvm/svm/sev.c

   646	
   647	static int __sev_dbg_decrypt_user(struct kvm *kvm, unsigned long paddr,
   648					  unsigned long __user dst_uaddr,
   649					  unsigned long dst_paddr,
   650					  int size, int *err)
   651	{
   652		struct page *tpage = NULL;
   653		int ret, offset;
   654	
   655		/* if inputs are not 16-byte then use intermediate buffer */
   656		if (!IS_ALIGNED(dst_paddr, 16) ||
   657		    !IS_ALIGNED(paddr,     16) ||
   658		    !IS_ALIGNED(size,      16)) {
   659			tpage = (void *)alloc_page(GFP_KERNEL);
   660			if (!tpage)
   661				return -ENOMEM;
   662	
   663			dst_paddr = __sme_page_pa(tpage);
   664		}
   665	
   666		ret = __sev_dbg_decrypt(kvm, paddr, dst_paddr, size, err);
   667		if (ret)
   668			goto e_free;
   669	
   670		if (tpage) {
   671			offset = paddr & 15;
 > 672			if (copy_to_user((void __user *)(uintptr_t)dst_uaddr,
   673					 page_address(tpage) + offset, size))
   674				ret = -EFAULT;
   675		}
   676	
   677	e_free:
   678		if (tpage)
   679			__free_page(tpage);
   680	
   681		return ret;
   682	}
   683	

---
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: 34248 bytes --]

             reply	other threads:[~2021-02-27 18:02 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-27 17:53 kernel test robot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-09-23  1:30 kernel test robot

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=202102280143.joh5OcJE-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=jroedel@suse.de \
    --cc=kbuild-all@lists.01.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®