tree: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git x86/hyperv head: 61eeb1f6d1f2648a218855d7c8d44f16df242ef3 commit: 6b48cb5f8347bc0153ff1d7b075db92e6723ffdb [1/6] X86/Hyper-V: Enlighten APIC access config: i386-randconfig-c0-05191955 (attached as .config) compiler: gcc-7 (Debian 7.3.0-16) 7.3.0 reproduce: git checkout 6b48cb5f8347bc0153ff1d7b075db92e6723ffdb # save the attached .config to linux build tree make ARCH=i386 All errors (new ones prefixed by >>): arch/x86/hyperv/hv_init.o: In function `hyperv_init': >> arch/x86/hyperv/hv_init.c:302: undefined reference to `hv_apic_init' vim +302 arch/x86/hyperv/hv_init.c 238 239 /* 240 * This function is to be invoked early in the boot sequence after the 241 * hypervisor has been detected. 242 * 243 * 1. Setup the hypercall page. 244 * 2. Register Hyper-V specific clocksource. 245 * 3. Setup Hyper-V specific APIC entry points. 246 */ 247 void __init hyperv_init(void) 248 { 249 u64 guest_id, required_msrs; 250 union hv_x64_msr_hypercall_contents hypercall_msr; 251 int cpuhp; 252 253 if (x86_hyper_type != X86_HYPER_MS_HYPERV) 254 return; 255 256 /* Absolutely required MSRs */ 257 required_msrs = HV_X64_MSR_HYPERCALL_AVAILABLE | 258 HV_X64_MSR_VP_INDEX_AVAILABLE; 259 260 if ((ms_hyperv.features & required_msrs) != required_msrs) 261 return; 262 263 /* Allocate percpu VP index */ 264 hv_vp_index = kmalloc_array(num_possible_cpus(), sizeof(*hv_vp_index), 265 GFP_KERNEL); 266 if (!hv_vp_index) 267 return; 268 269 hv_vp_assist_page = kcalloc(num_possible_cpus(), 270 sizeof(*hv_vp_assist_page), GFP_KERNEL); 271 if (!hv_vp_assist_page) { 272 ms_hyperv.hints &= ~HV_X64_ENLIGHTENED_VMCS_RECOMMENDED; 273 goto free_vp_index; 274 } 275 276 cpuhp = cpuhp_setup_state(CPUHP_AP_ONLINE_DYN, "x86/hyperv_init:online", 277 hv_cpu_init, hv_cpu_die); 278 if (cpuhp < 0) 279 goto free_vp_assist_page; 280 281 /* 282 * Setup the hypercall page and enable hypercalls. 283 * 1. Register the guest ID 284 * 2. Enable the hypercall and register the hypercall page 285 */ 286 guest_id = generate_guest_id(0, LINUX_VERSION_CODE, 0); 287 wrmsrl(HV_X64_MSR_GUEST_OS_ID, guest_id); 288 289 hv_hypercall_pg = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL_RX); 290 if (hv_hypercall_pg == NULL) { 291 wrmsrl(HV_X64_MSR_GUEST_OS_ID, 0); 292 goto remove_cpuhp_state; 293 } 294 295 rdmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 296 hypercall_msr.enable = 1; 297 hypercall_msr.guest_physical_address = vmalloc_to_pfn(hv_hypercall_pg); 298 wrmsrl(HV_X64_MSR_HYPERCALL, hypercall_msr.as_uint64); 299 300 hyper_alloc_mmu(); 301 > 302 hv_apic_init(); 303 304 /* 305 * Register Hyper-V specific clocksource. 306 */ 307 #ifdef CONFIG_HYPERV_TSCPAGE 308 if (ms_hyperv.features & HV_X64_MSR_REFERENCE_TSC_AVAILABLE) { 309 union hv_x64_msr_hypercall_contents tsc_msr; 310 311 tsc_pg = __vmalloc(PAGE_SIZE, GFP_KERNEL, PAGE_KERNEL); 312 if (!tsc_pg) 313 goto register_msr_cs; 314 315 hyperv_cs = &hyperv_cs_tsc; 316 317 rdmsrl(HV_X64_MSR_REFERENCE_TSC, tsc_msr.as_uint64); 318 319 tsc_msr.enable = 1; 320 tsc_msr.guest_physical_address = vmalloc_to_pfn(tsc_pg); 321 322 wrmsrl(HV_X64_MSR_REFERENCE_TSC, tsc_msr.as_uint64); 323 324 hyperv_cs_tsc.archdata.vclock_mode = VCLOCK_HVCLOCK; 325 326 clocksource_register_hz(&hyperv_cs_tsc, NSEC_PER_SEC/100); 327 return; 328 } 329 register_msr_cs: 330 #endif 331 /* 332 * For 32 bit guests just use the MSR based mechanism for reading 333 * the partition counter. 334 */ 335 336 hyperv_cs = &hyperv_cs_msr; 337 if (ms_hyperv.features & HV_X64_MSR_TIME_REF_COUNT_AVAILABLE) 338 clocksource_register_hz(&hyperv_cs_msr, NSEC_PER_SEC/100); 339 340 return; 341 342 remove_cpuhp_state: 343 cpuhp_remove_state(cpuhp); 344 free_vp_assist_page: 345 kfree(hv_vp_assist_page); 346 hv_vp_assist_page = NULL; 347 free_vp_index: 348 kfree(hv_vp_index); 349 hv_vp_index = NULL; 350 } 351 --- 0-DAY kernel test infrastructure Open Source Technology Center https://lists.01.org/pipermail/kbuild-all Intel Corporation