public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Like Xu <like.xu.linux@gmail.com>
To: Peter Xu <peterx@redhat.com>
Cc: clang-built-linux@googlegroups.com, kbuild-all@lists.01.org,
	kvm@vger.kernel.org, Robert Hu <robert.hu@intel.com>,
	Farrah Chen <farrah.chen@intel.com>,
	Danmei Wei <danmei.wei@intel.com>,
	Paolo Bonzini <pbonzini@redhat.com>,
	kernel test robot <lkp@intel.com>
Subject: Re: [kvm:queue 89/92] arch/x86/kvm/debugfs.c:115:18: error: implicit declaration of function 'kvm_mmu_slot_lpages'
Date: Wed, 4 Aug 2021 16:26:24 +0800	[thread overview]
Message-ID: <79f2b495-4277-5794-e7ca-34eca755f673@gmail.com> (raw)
In-Reply-To: <202108040409.71rYZOtR-lkp@intel.com>

Fixes: 0ba436e56da7 ("KVM: X86: Introduce kvm_mmu_slot_lpages() helpers")

diff --git a/arch/x86/kvm/debugfs.c b/arch/x86/kvm/debugfs.c
index 62a61bfdd680..4fa519caaef7 100644
--- a/arch/x86/kvm/debugfs.c
+++ b/arch/x86/kvm/debugfs.c
@@ -7,6 +7,7 @@
  #include <linux/kvm_host.h>
  #include <linux/debugfs.h>
  #include "lapic.h"
+#include "mmu.h"
  #include "mmu/mmu_internal.h"

  static int vcpu_get_timer_advance_ns(void *data, u64 *val)

On 4/8/2021 4:37 am, kernel test robot wrote:
> tree:   https://git.kernel.org/pub/scm/virt/kvm/kvm.git queue
> head:   6cd974485e2574d94221268760d84c9c19d1c4ff
> commit: 53c1304cfe8446c0bfbe2dcac1995bfa5907a1d2 [89/92] KVM: X86: Introduce mmu_rmaps_stat per-vm debugfs file
> config: x86_64-randconfig-a011-20210803 (attached as .config)
> compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 4f71f59bf3d9914188a11d0c41bedbb339d36ff5)
> reproduce (this is a W=1 build):
>          wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
>          chmod +x ~/bin/make.cross
>          # https://git.kernel.org/pub/scm/virt/kvm/kvm.git/commit/?id=53c1304cfe8446c0bfbe2dcac1995bfa5907a1d2
>          git remote add kvm https://git.kernel.org/pub/scm/virt/kvm/kvm.git
>          git fetch --no-tags kvm queue
>          git checkout 53c1304cfe8446c0bfbe2dcac1995bfa5907a1d2
>          # save the attached .config to linux build tree
>          COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
> 
> If you fix the issue, kindly add following tag as appropriate
> Reported-by: kernel test robot <lkp@intel.com>
> 
> All errors (new ones prefixed by >>):
> 
>>> arch/x86/kvm/debugfs.c:115:18: error: implicit declaration of function 'kvm_mmu_slot_lpages' [-Werror,-Wimplicit-function-declaration]
>                                     lpage_size = kvm_mmu_slot_lpages(slot, k + 1);
>                                                  ^
>     1 error generated.
> 
> 
> vim +/kvm_mmu_slot_lpages +115 arch/x86/kvm/debugfs.c
> 
>      85	
>      86	static int kvm_mmu_rmaps_stat_show(struct seq_file *m, void *v)
>      87	{
>      88		struct kvm_rmap_head *rmap;
>      89		struct kvm *kvm = m->private;
>      90		struct kvm_memory_slot *slot;
>      91		struct kvm_memslots *slots;
>      92		unsigned int lpage_size, index;
>      93		/* Still small enough to be on the stack */
>      94		unsigned int *log[KVM_NR_PAGE_SIZES], *cur;
>      95		int i, j, k, l, ret;
>      96	
>      97		memset(log, 0, sizeof(log));
>      98	
>      99		ret = -ENOMEM;
>     100		for (i = 0; i < KVM_NR_PAGE_SIZES; i++) {
>     101			log[i] = kzalloc(RMAP_LOG_SIZE * sizeof(unsigned int), GFP_KERNEL);
>     102			if (!log[i])
>     103				goto out;
>     104		}
>     105	
>     106		mutex_lock(&kvm->slots_lock);
>     107		write_lock(&kvm->mmu_lock);
>     108	
>     109		for (i = 0; i < KVM_ADDRESS_SPACE_NUM; i++) {
>     110			slots = __kvm_memslots(kvm, i);
>     111			for (j = 0; j < slots->used_slots; j++) {
>     112				slot = &slots->memslots[j];
>     113				for (k = 0; k < KVM_NR_PAGE_SIZES; k++) {
>     114					rmap = slot->arch.rmap[k];
>   > 115					lpage_size = kvm_mmu_slot_lpages(slot, k + 1);
>     116					cur = log[k];
>     117					for (l = 0; l < lpage_size; l++) {
>     118						index = ffs(pte_list_count(&rmap[l]));
>     119						if (WARN_ON_ONCE(index >= RMAP_LOG_SIZE))
>     120							index = RMAP_LOG_SIZE - 1;
>     121						cur[index]++;
>     122					}
>     123				}
>     124			}
>     125		}
>     126	
>     127		write_unlock(&kvm->mmu_lock);
>     128		mutex_unlock(&kvm->slots_lock);
>     129	
>     130		/* index=0 counts no rmap; index=1 counts 1 rmap */
>     131		seq_printf(m, "Rmap_Count:\t0\t1\t");
>     132		for (i = 2; i < RMAP_LOG_SIZE; i++) {
>     133			j = 1 << (i - 1);
>     134			k = (1 << i) - 1;
>     135			seq_printf(m, "%d-%d\t", j, k);
>     136		}
>     137		seq_printf(m, "\n");
>     138	
>     139		for (i = 0; i < KVM_NR_PAGE_SIZES; i++) {
>     140			seq_printf(m, "Level=%s:\t", kvm_lpage_str[i]);
>     141			cur = log[i];
>     142			for (j = 0; j < RMAP_LOG_SIZE; j++)
>     143				seq_printf(m, "%d\t", cur[j]);
>     144			seq_printf(m, "\n");
>     145		}
>     146	
>     147		ret = 0;
>     148	out:
>     149		for (i = 0; i < KVM_NR_PAGE_SIZES; i++)
>     150			if (log[i])
>     151				kfree(log[i]);
>     152	
>     153		return ret;
>     154	}
>     155	
> 
> ---
> 0-DAY CI Kernel Test Service, Intel Corporation
> https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
> 

      reply	other threads:[~2021-08-04  8:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-03 20:37 [kvm:queue 89/92] arch/x86/kvm/debugfs.c:115:18: error: implicit declaration of function 'kvm_mmu_slot_lpages' kernel test robot
2021-08-04  8:26 ` Like Xu [this message]

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=79f2b495-4277-5794-e7ca-34eca755f673@gmail.com \
    --to=like.xu.linux@gmail.com \
    --cc=clang-built-linux@googlegroups.com \
    --cc=danmei.wei@intel.com \
    --cc=farrah.chen@intel.com \
    --cc=kbuild-all@lists.01.org \
    --cc=kvm@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=pbonzini@redhat.com \
    --cc=peterx@redhat.com \
    --cc=robert.hu@intel.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