[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202105140556.uCsK6QmT-lkp@intel.com>
Date: Fri, 14 May 2021 05:23:20 +0800
From: kernel test robot <lkp@...el.com>
To: Quentin Perret <qperret@...gle.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Marc Zyngier <maz@...nel.org>, Will Deacon <will@...nel.org>
Subject: arch/arm64/kvm/hyp/nvhe/setup.c:19:27: sparse: sparse: symbol
'pkvm_pgtable_mm_ops' was not declared. Should it be static?
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head: 315d99318179b9cd5077ccc9f7f26a164c9fa998
commit: f320bc742bc23c1d43567712fe2814bf04b19ebc KVM: arm64: Prepare the creation of s1 mappings at EL2
date: 8 weeks ago
config: arm64-randconfig-s032-20210513 (attached as .config)
compiler: aarch64-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-341-g8af24329-dirty
# https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=f320bc742bc23c1d43567712fe2814bf04b19ebc
git remote add linus https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
git fetch --no-tags linus master
git checkout f320bc742bc23c1d43567712fe2814bf04b19ebc
# 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__' W=1 ARCH=arm64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> arch/arm64/kvm/hyp/nvhe/setup.c:19:27: sparse: sparse: symbol 'pkvm_pgtable_mm_ops' was not declared. Should it be static?
vim +/pkvm_pgtable_mm_ops +19 arch/arm64/kvm/hyp/nvhe/setup.c
18
> 19 struct hyp_pool hpool;
> 20 struct kvm_pgtable_mm_ops pkvm_pgtable_mm_ops;
21 unsigned long hyp_nr_cpus;
22
23 #define hyp_percpu_size ((unsigned long)__per_cpu_end - \
24 (unsigned long)__per_cpu_start)
25
26 static void *vmemmap_base;
27 static void *hyp_pgt_base;
28 static void *host_s2_mem_pgt_base;
29 static void *host_s2_dev_pgt_base;
30
31 static int divide_memory_pool(void *virt, unsigned long size)
32 {
33 unsigned long vstart, vend, nr_pages;
34
35 hyp_early_alloc_init(virt, size);
36
37 hyp_vmemmap_range(__hyp_pa(virt), size, &vstart, &vend);
38 nr_pages = (vend - vstart) >> PAGE_SHIFT;
39 vmemmap_base = hyp_early_alloc_contig(nr_pages);
40 if (!vmemmap_base)
41 return -ENOMEM;
42
43 nr_pages = hyp_s1_pgtable_pages();
44 hyp_pgt_base = hyp_early_alloc_contig(nr_pages);
45 if (!hyp_pgt_base)
46 return -ENOMEM;
47
48 nr_pages = host_s2_mem_pgtable_pages();
49 host_s2_mem_pgt_base = hyp_early_alloc_contig(nr_pages);
50 if (!host_s2_mem_pgt_base)
51 return -ENOMEM;
52
53 nr_pages = host_s2_dev_pgtable_pages();
54 host_s2_dev_pgt_base = hyp_early_alloc_contig(nr_pages);
55 if (!host_s2_dev_pgt_base)
56 return -ENOMEM;
57
58 return 0;
59 }
60
61 static int recreate_hyp_mappings(phys_addr_t phys, unsigned long size,
62 unsigned long *per_cpu_base,
63 u32 hyp_va_bits)
64 {
65 void *start, *end, *virt = hyp_phys_to_virt(phys);
66 unsigned long pgt_size = hyp_s1_pgtable_pages() << PAGE_SHIFT;
67 int ret, i;
68
69 /* Recreate the hyp page-table using the early page allocator */
70 hyp_early_alloc_init(hyp_pgt_base, pgt_size);
71 ret = kvm_pgtable_hyp_init(&pkvm_pgtable, hyp_va_bits,
72 &hyp_early_alloc_mm_ops);
73 if (ret)
74 return ret;
75
76 ret = hyp_create_idmap(hyp_va_bits);
77 if (ret)
78 return ret;
79
80 ret = hyp_map_vectors();
81 if (ret)
82 return ret;
83
84 ret = hyp_back_vmemmap(phys, size, hyp_virt_to_phys(vmemmap_base));
85 if (ret)
86 return ret;
87
88 ret = pkvm_create_mappings(__hyp_text_start, __hyp_text_end, PAGE_HYP_EXEC);
89 if (ret)
90 return ret;
91
92 ret = pkvm_create_mappings(__start_rodata, __end_rodata, PAGE_HYP_RO);
93 if (ret)
94 return ret;
95
96 ret = pkvm_create_mappings(__hyp_rodata_start, __hyp_rodata_end, PAGE_HYP_RO);
97 if (ret)
98 return ret;
99
100 ret = pkvm_create_mappings(__hyp_bss_start, __hyp_bss_end, PAGE_HYP);
101 if (ret)
102 return ret;
103
104 ret = pkvm_create_mappings(__hyp_bss_end, __bss_stop, PAGE_HYP_RO);
105 if (ret)
106 return ret;
107
108 ret = pkvm_create_mappings(virt, virt + size, PAGE_HYP);
109 if (ret)
110 return ret;
111
112 for (i = 0; i < hyp_nr_cpus; i++) {
113 start = (void *)kern_hyp_va(per_cpu_base[i]);
114 end = start + PAGE_ALIGN(hyp_percpu_size);
115 ret = pkvm_create_mappings(start, end, PAGE_HYP);
116 if (ret)
117 return ret;
118
119 end = (void *)per_cpu_ptr(&kvm_init_params, i)->stack_hyp_va;
120 start = end - PAGE_SIZE;
121 ret = pkvm_create_mappings(start, end, PAGE_HYP);
122 if (ret)
123 return ret;
124 }
125
126 return 0;
127 }
128
129 static void update_nvhe_init_params(void)
130 {
131 struct kvm_nvhe_init_params *params;
132 unsigned long i;
> 133
134 for (i = 0; i < hyp_nr_cpus; i++) {
135 params = per_cpu_ptr(&kvm_init_params, i);
136 params->pgd_pa = __hyp_pa(pkvm_pgtable.pgd);
137 __flush_dcache_area(params, sizeof(*params));
138 }
139 }
140
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (43914 bytes)
Powered by blists - more mailing lists