* [android-common:android14-5.15 9/18] arch/arm64/kvm/hyp_trace.c:245:6: sparse: sparse: symbol 'hyp_poke_tracing' was not declared. Should it be static?
@ 2023-12-08 15:40 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2023-12-08 15:40 UTC (permalink / raw)
To: cros-kernel-buildreports; +Cc: oe-kbuild-all
tree: https://android.googlesource.com/kernel/common android14-5.15
head: bd5883688256f8eaf708cad509ce2a47ec8384aa
commit: 64f573257e8c787e0e7bd1bcfd216feca4a0f6bd [9/18] ANDROID: KVM: arm64: Flush hyp trace pipe when tracing stops
config: arm64-randconfig-r121-20231207 (https://download.01.org/0day-ci/archive/20231208/202312082354.RUEKuSlB-lkp@intel.com/config)
compiler: aarch64-linux-gcc (GCC) 13.2.0
reproduce: (https://download.01.org/0day-ci/archive/20231208/202312082354.RUEKuSlB-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202312082354.RUEKuSlB-lkp@intel.com/
sparse warnings: (new ones prefixed by >>)
arch/arm64/kvm/hyp_trace.c:102:27: sparse: sparse: symbol 'hyp_cb' was not declared. Should it be static?
>> arch/arm64/kvm/hyp_trace.c:245:6: sparse: sparse: symbol 'hyp_poke_tracing' was not declared. Should it be static?
arch/arm64/kvm/hyp_trace.c:713:5: sparse: sparse: symbol 'hyp_trace_release' was not declared. Should it be static?
vim +/hyp_poke_tracing +245 arch/arm64/kvm/hyp_trace.c
101
> 102 struct ring_buffer_ext_cb hyp_cb = {
103 .update_footers = __update_footers,
104 .swap_reader = __swap_reader_page,
105 };
106
107 static inline int share_page(unsigned long va)
108 {
109 return kvm_call_hyp_nvhe(__pkvm_host_share_hyp, virt_to_pfn(va), 1);
110 }
111
112 static inline int unshare_page(unsigned long va)
113 {
114 return kvm_call_hyp_nvhe(__pkvm_host_unshare_hyp, virt_to_pfn(va), 1);
115 }
116
117 static int trace_pack_pages_apply(struct trace_buffer_pack *trace_pack,
118 int (*func)(unsigned long))
119 {
120 struct ring_buffer_pack *rb_pack;
121 int cpu, i, ret;
122
123 for_each_ring_buffer_pack(rb_pack, cpu, trace_pack) {
124 ret = func(rb_pack->reader_page_va);
125 if (ret)
126 return ret;
127
128 for (i = 0; i < rb_pack->nr_pages; i++) {
129 ret = func(rb_pack->page_va[i]);
130 if (ret)
131 return ret;
132 }
133 }
134
135 return 0;
136 }
137
138 /*
139 * hyp_trace_pack size depends on trace_buffer_pack's, so
140 * trace_buffer_setup is in charge of the allocation for the former.
141 */
142 static int trace_buffer_setup(struct hyp_trace_pack **pack, size_t *pack_size)
143 {
144 struct trace_buffer_pack *trace_pack;
145 int ret;
146
147 hyp_trace_buffer = ring_buffer_alloc_ext(hyp_trace_buffer_size, &hyp_cb);
148 if (!hyp_trace_buffer)
149 return -ENOMEM;
150
151 *pack_size = offsetof(struct hyp_trace_pack, trace_buffer_pack) +
152 trace_buffer_pack_size(hyp_trace_buffer);
153 /*
154 * The hypervisor will unmap the pack from the host to protect the
155 * reading. Page granularity for the pack allocation ensures no other
156 * useful data will be unmapped.
157 */
158 *pack_size = PAGE_ALIGN(*pack_size);
159 *pack = alloc_pages_exact(*pack_size, GFP_KERNEL);
160 if (!*pack) {
161 ret = -ENOMEM;
162 goto err;
163 }
164
165 trace_pack = &(*pack)->trace_buffer_pack;
166 WARN_ON(trace_buffer_pack(hyp_trace_buffer, trace_pack));
167
168 ret = trace_pack_pages_apply(trace_pack, share_page);
169 if (ret) {
170 trace_pack_pages_apply(trace_pack, unshare_page);
171 free_pages_exact(*pack, *pack_size);
172 goto err;
173 }
174
175 return 0;
176 err:
177 ring_buffer_free(hyp_trace_buffer);
178 hyp_trace_buffer = NULL;
179
180 return ret;
181 }
182
183 static void trace_buffer_teardown(struct trace_buffer_pack *trace_pack)
184 {
185 bool alloc_trace_pack = !trace_pack;
186
187 if (alloc_trace_pack) {
188 trace_pack = kzalloc(trace_buffer_pack_size(hyp_trace_buffer), GFP_KERNEL);
189 if (!trace_pack) {
190 WARN_ON(1);
191 goto end;
192 }
193 }
194
195 WARN_ON(trace_buffer_pack(hyp_trace_buffer, trace_pack));
196 WARN_ON(trace_pack_pages_apply(trace_pack, unshare_page));
197
198 if (alloc_trace_pack)
199 kfree(trace_pack);
200 end:
201 ring_buffer_free(hyp_trace_buffer);
202 hyp_trace_buffer = NULL;
203 }
204
205 static int hyp_load_tracing(void)
206 {
207 struct hyp_trace_pack *pack;
208 size_t pack_size;
209 int ret;
210
211 ret = trace_buffer_setup(&pack, &pack_size);
212 if (ret)
213 return ret;
214
215 hyp_clock_setup(pack);
216
217 ret = bpage_backing_setup(pack);
218 if (ret)
219 goto end_buffer_teardown;
220
221 ret = kvm_call_hyp_nvhe(__pkvm_load_tracing, (unsigned long)pack, pack_size);
222 if (!ret)
223 goto end_free_pack;
224
225 bpage_backing_teardown();
226 end_buffer_teardown:
227 trace_buffer_teardown(&pack->trace_buffer_pack);
228 end_free_pack:
229 free_pages_exact(pack, pack_size);
230
231 return ret;
232 }
233
234 static void hyp_free_tracing(void)
235 {
236 WARN_ON(hyp_trace_readers || hyp_trace_on);
237
238 if (WARN_ON(kvm_call_hyp_nvhe(__pkvm_teardown_tracing)))
239 return;
240
241 trace_buffer_teardown(NULL);
242 bpage_backing_teardown();
243 }
244
> 245 void hyp_poke_tracing(int cpu, const struct cpumask *cpus)
246 {
247 if (cpu == RING_BUFFER_ALL_CPUS) {
248 for_each_cpu(cpu, cpus)
249 WARN_ON_ONCE(ring_buffer_poke(hyp_trace_buffer, cpu));
250 } else {
251 WARN_ON_ONCE(ring_buffer_poke(hyp_trace_buffer, cpu));
252 }
253 }
254
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2023-12-08 15:41 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-12-08 15:40 [android-common:android14-5.15 9/18] arch/arm64/kvm/hyp_trace.c:245:6: sparse: sparse: symbol 'hyp_poke_tracing' was not declared. Should it be static? 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.