tree: git://git.infradead.org/users/hch/misc.git hyperv-vmap head: 8248f295928aded3364a1e54a4e0022e93d3610c commit: 2d802447e20b42b1801e7a03386318ed5b929fe0 [37/49] HV/Vmbus: Add SNP support for VMbus channel initiate message config: arm64-allyesconfig (attached as .config) compiler: aarch64-linux-gcc (GCC) 11.2.0 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 git remote add hch-misc git://git.infradead.org/users/hch/misc.git git fetch --no-tags hch-misc hyperv-vmap git checkout 2d802447e20b42b1801e7a03386318ed5b929fe0 # save the attached .config to linux build tree COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross ARCH=arm64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot All errors (new ones prefixed by >>): In file included from arch/arm64/include/asm/mshyperv.h:52, from drivers/hv/connection.c:23: include/asm-generic/mshyperv.h: In function 'vmbus_signal_eom': include/asm-generic/mshyperv.h:153:17: error: implicit declaration of function 'hv_signal_eom'; did you mean 'vmbus_signal_eom'? [-Werror=implicit-function-declaration] 153 | hv_signal_eom(old_msg_type); | ^~~~~~~~~~~~~ | vmbus_signal_eom drivers/hv/connection.c: In function 'vmbus_connect': >> drivers/hv/connection.c:255:21: error: implicit declaration of function 'hv_mark_gpa_visibility' [-Werror=implicit-function-declaration] 255 | if (hv_mark_gpa_visibility(2, pfn, | ^~~~~~~~~~~~~~~~~~~~~~ >> drivers/hv/connection.c:256:33: error: 'VMBUS_PAGE_VISIBLE_READ_WRITE' undeclared (first use in this function) 256 | VMBUS_PAGE_VISIBLE_READ_WRITE)) { | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ drivers/hv/connection.c:256:33: note: each undeclared identifier is reported only once for each function it appears in drivers/hv/connection.c: In function 'vmbus_disconnect': >> drivers/hv/connection.c:368:48: error: 'VMBUS_PAGE_NOT_VISIBLE' undeclared (first use in this function) 368 | hv_mark_gpa_visibility(2, pfn, VMBUS_PAGE_NOT_VISIBLE); | ^~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors vim +/hv_mark_gpa_visibility +255 drivers/hv/connection.c 185 186 /* 187 * vmbus_connect - Sends a connect request on the partition service connection 188 */ 189 int vmbus_connect(void) 190 { 191 struct vmbus_channel_msginfo *msginfo = NULL; 192 int i, ret = 0; 193 __u32 version; 194 u64 pfn[2]; 195 196 /* Initialize the vmbus connection */ 197 vmbus_connection.conn_state = CONNECTING; 198 vmbus_connection.work_queue = create_workqueue("hv_vmbus_con"); 199 if (!vmbus_connection.work_queue) { 200 ret = -ENOMEM; 201 goto cleanup; 202 } 203 204 vmbus_connection.handle_primary_chan_wq = 205 create_workqueue("hv_pri_chan"); 206 if (!vmbus_connection.handle_primary_chan_wq) { 207 ret = -ENOMEM; 208 goto cleanup; 209 } 210 211 vmbus_connection.handle_sub_chan_wq = 212 create_workqueue("hv_sub_chan"); 213 if (!vmbus_connection.handle_sub_chan_wq) { 214 ret = -ENOMEM; 215 goto cleanup; 216 } 217 218 INIT_LIST_HEAD(&vmbus_connection.chn_msg_list); 219 spin_lock_init(&vmbus_connection.channelmsg_lock); 220 221 INIT_LIST_HEAD(&vmbus_connection.chn_list); 222 mutex_init(&vmbus_connection.channel_mutex); 223 224 /* 225 * Setup the vmbus event connection for channel interrupt 226 * abstraction stuff 227 */ 228 vmbus_connection.int_page = 229 (void *)hv_alloc_hyperv_zeroed_page(); 230 if (vmbus_connection.int_page == NULL) { 231 ret = -ENOMEM; 232 goto cleanup; 233 } 234 235 vmbus_connection.recv_int_page = vmbus_connection.int_page; 236 vmbus_connection.send_int_page = 237 (void *)((unsigned long)vmbus_connection.int_page + 238 (HV_HYP_PAGE_SIZE >> 1)); 239 240 /* 241 * Setup the monitor notification facility. The 1st page for 242 * parent->child and the 2nd page for child->parent 243 */ 244 vmbus_connection.monitor_pages[0] = (void *)hv_alloc_hyperv_zeroed_page(); 245 vmbus_connection.monitor_pages[1] = (void *)hv_alloc_hyperv_zeroed_page(); 246 if ((vmbus_connection.monitor_pages[0] == NULL) || 247 (vmbus_connection.monitor_pages[1] == NULL)) { 248 ret = -ENOMEM; 249 goto cleanup; 250 } 251 252 if (hv_is_isolation_supported()) { 253 pfn[0] = virt_to_hvpfn(vmbus_connection.monitor_pages[0]); 254 pfn[1] = virt_to_hvpfn(vmbus_connection.monitor_pages[1]); > 255 if (hv_mark_gpa_visibility(2, pfn, > 256 VMBUS_PAGE_VISIBLE_READ_WRITE)) { 257 ret = -EFAULT; 258 goto cleanup; 259 } 260 } 261 262 msginfo = kzalloc(sizeof(*msginfo) + 263 sizeof(struct vmbus_channel_initiate_contact), 264 GFP_KERNEL); 265 if (msginfo == NULL) { 266 ret = -ENOMEM; 267 goto cleanup; 268 } 269 270 /* 271 * Negotiate a compatible VMBUS version number with the 272 * host. We start with the highest number we can support 273 * and work our way down until we negotiate a compatible 274 * version. 275 */ 276 277 for (i = 0; ; i++) { 278 if (i == ARRAY_SIZE(vmbus_versions)) { 279 ret = -EDOM; 280 goto cleanup; 281 } 282 283 version = vmbus_versions[i]; 284 if (version > max_version) 285 continue; 286 287 ret = vmbus_negotiate_version(msginfo, version); 288 if (ret == -ETIMEDOUT) 289 goto cleanup; 290 291 if (vmbus_connection.conn_state == CONNECTED) 292 break; 293 } 294 295 if (hv_is_isolation_supported() && version < VERSION_WIN10_V5_2) { 296 pr_err("Invalid VMBus version %d.%d (expected >= %d.%d) from the host supporting isolation\n", 297 version >> 16, version & 0xFFFF, VERSION_WIN10_V5_2 >> 16, VERSION_WIN10_V5_2 & 0xFFFF); 298 ret = -EINVAL; 299 goto cleanup; 300 } 301 302 vmbus_proto_version = version; 303 pr_info("Vmbus version:%d.%d\n", 304 version >> 16, version & 0xFFFF); 305 306 vmbus_connection.channels = kcalloc(MAX_CHANNEL_RELIDS, 307 sizeof(struct vmbus_channel *), 308 GFP_KERNEL); 309 if (vmbus_connection.channels == NULL) { 310 ret = -ENOMEM; 311 goto cleanup; 312 } 313 314 kfree(msginfo); 315 return 0; 316 317 cleanup: 318 pr_err("Unable to connect to host\n"); 319 320 vmbus_connection.conn_state = DISCONNECTED; 321 vmbus_disconnect(); 322 323 kfree(msginfo); 324 325 return ret; 326 } 327 328 void vmbus_disconnect(void) 329 { 330 u64 pfn[2]; 331 332 /* 333 * First send the unload request to the host. 334 */ 335 vmbus_initiate_unload(false); 336 337 if (vmbus_connection.handle_sub_chan_wq) 338 destroy_workqueue(vmbus_connection.handle_sub_chan_wq); 339 340 if (vmbus_connection.handle_primary_chan_wq) 341 destroy_workqueue(vmbus_connection.handle_primary_chan_wq); 342 343 if (vmbus_connection.work_queue) 344 destroy_workqueue(vmbus_connection.work_queue); 345 346 if (vmbus_connection.int_page) { 347 hv_free_hyperv_page((unsigned long)vmbus_connection.int_page); 348 vmbus_connection.int_page = NULL; 349 } 350 351 if (hv_is_isolation_supported()) { 352 if (vmbus_connection.monitor_pages_va[0]) { 353 memunmap(vmbus_connection.monitor_pages[0]); 354 vmbus_connection.monitor_pages[0] 355 = vmbus_connection.monitor_pages_va[0]; 356 vmbus_connection.monitor_pages_va[0] = NULL; 357 } 358 359 if (vmbus_connection.monitor_pages_va[1]) { 360 memunmap(vmbus_connection.monitor_pages[1]); 361 vmbus_connection.monitor_pages[1] 362 = vmbus_connection.monitor_pages_va[1]; 363 vmbus_connection.monitor_pages_va[1] = NULL; 364 } 365 366 pfn[0] = virt_to_hvpfn(vmbus_connection.monitor_pages[0]); 367 pfn[1] = virt_to_hvpfn(vmbus_connection.monitor_pages[1]); > 368 hv_mark_gpa_visibility(2, pfn, VMBUS_PAGE_NOT_VISIBLE); 369 } 370 371 hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[0]); 372 hv_free_hyperv_page((unsigned long)vmbus_connection.monitor_pages[1]); 373 vmbus_connection.monitor_pages[0] = NULL; 374 vmbus_connection.monitor_pages[1] = NULL; 375 } 376 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org