@@ -332,15 +332,15 @@ static int32_t check_vmx_mmu_cap(void)
332
332
int32_t ret = 0 ;
333
333
334
334
if (!pcpu_has_vmx_ept_cap (VMX_EPT_INVEPT )) {
335
- pr_fatal ("%s, invept not supported\n" , __func__ );
335
+ printf ("%s, invept not supported\n" , __func__ );
336
336
ret = - ENODEV ;
337
337
} else if (!pcpu_has_vmx_vpid_cap (VMX_VPID_INVVPID ) ||
338
338
!pcpu_has_vmx_vpid_cap (VMX_VPID_INVVPID_SINGLE_CONTEXT ) ||
339
339
!pcpu_has_vmx_vpid_cap (VMX_VPID_INVVPID_GLOBAL_CONTEXT )) {
340
- pr_fatal ("%s, invvpid not supported\n" , __func__ );
340
+ printf ("%s, invvpid not supported\n" , __func__ );
341
341
ret = - ENODEV ;
342
342
} else if (!pcpu_has_vmx_ept_cap (VMX_EPT_1GB_PAGE )) {
343
- pr_fatal ("%s, ept not support 1GB large page\n" , __func__ );
343
+ printf ("%s, ept not support 1GB large page\n" , __func__ );
344
344
ret = - ENODEV ;
345
345
} else {
346
346
/* No other state currently, do nothing */
@@ -361,65 +361,65 @@ int32_t detect_hardware_support(void)
361
361
362
362
/* Long Mode (x86-64, 64-bit support) */
363
363
if (!pcpu_has_cap (X86_FEATURE_LM )) {
364
- pr_fatal ("%s, LM not supported\n" , __func__ );
364
+ printf ("%s, LM not supported\n" , __func__ );
365
365
ret = - ENODEV ;
366
366
} else if ((boot_cpu_data .phys_bits == 0U ) ||
367
367
(boot_cpu_data .virt_bits == 0U )) {
368
- pr_fatal ("%s, can't detect Linear/Physical Address size\n" , __func__ );
368
+ printf ("%s, can't detect Linear/Physical Address size\n" , __func__ );
369
369
ret = - ENODEV ;
370
370
} else if (!pcpu_has_cap (X86_FEATURE_TSC_DEADLINE )) {
371
371
/* lapic TSC deadline timer */
372
- pr_fatal ("%s, TSC deadline not supported\n" , __func__ );
372
+ printf ("%s, TSC deadline not supported\n" , __func__ );
373
373
ret = - ENODEV ;
374
374
} else if (!pcpu_has_cap (X86_FEATURE_NX )) {
375
375
/* Execute Disable */
376
- pr_fatal ("%s, NX not supported\n" , __func__ );
376
+ printf ("%s, NX not supported\n" , __func__ );
377
377
ret = - ENODEV ;
378
378
} else if (!pcpu_has_cap (X86_FEATURE_SMEP )) {
379
379
/* Supervisor-Mode Execution Prevention */
380
- pr_fatal ("%s, SMEP not supported\n" , __func__ );
380
+ printf ("%s, SMEP not supported\n" , __func__ );
381
381
ret = - ENODEV ;
382
382
} else if (!pcpu_has_cap (X86_FEATURE_SMAP )) {
383
383
/* Supervisor-Mode Access Prevention */
384
- pr_fatal ("%s, SMAP not supported\n" , __func__ );
384
+ printf ("%s, SMAP not supported\n" , __func__ );
385
385
ret = - ENODEV ;
386
386
} else if (!pcpu_has_cap (X86_FEATURE_MTRR )) {
387
- pr_fatal ("%s, MTRR not supported\n" , __func__ );
387
+ printf ("%s, MTRR not supported\n" , __func__ );
388
388
ret = - ENODEV ;
389
389
} else if (!pcpu_has_cap (X86_FEATURE_CLFLUSHOPT )) {
390
- pr_fatal ("%s, CLFLUSHOPT not supported\n" , __func__ );
390
+ printf ("%s, CLFLUSHOPT not supported\n" , __func__ );
391
391
ret = - ENODEV ;
392
392
} else if (!pcpu_has_cap (X86_FEATURE_PAGE1GB )) {
393
- pr_fatal ("%s, not support 1GB page\n" , __func__ );
393
+ printf ("%s, not support 1GB page\n" , __func__ );
394
394
ret = - ENODEV ;
395
395
} else if (!pcpu_has_cap (X86_FEATURE_VMX )) {
396
- pr_fatal ("%s, vmx not supported\n" , __func__ );
396
+ printf ("%s, vmx not supported\n" , __func__ );
397
397
ret = - ENODEV ;
398
398
} else if (!is_fast_string_erms_supported_and_enabled ()) {
399
399
ret = - ENODEV ;
400
400
} else if (!pcpu_has_vmx_unrestricted_guest_cap ()) {
401
- pr_fatal ("%s, unrestricted guest not supported\n" , __func__ );
401
+ printf ("%s, unrestricted guest not supported\n" , __func__ );
402
402
ret = - ENODEV ;
403
403
} else if (!is_ept_supported ()) {
404
- pr_fatal ("%s, EPT not supported\n" , __func__ );
404
+ printf ("%s, EPT not supported\n" , __func__ );
405
405
ret = - ENODEV ;
406
406
} else if (!is_apicv_basic_feature_supported ()) {
407
- pr_fatal ("%s, APICV not supported\n" , __func__ );
407
+ printf ("%s, APICV not supported\n" , __func__ );
408
408
ret = - ENODEV ;
409
409
} else if (boot_cpu_data .cpuid_level < 0x15U ) {
410
- pr_fatal ("%s, required CPU feature not supported\n" , __func__ );
410
+ printf ("%s, required CPU feature not supported\n" , __func__ );
411
411
ret = - ENODEV ;
412
412
} else if (is_vmx_disabled ()) {
413
- pr_fatal ("%s, VMX can not be enabled\n" , __func__ );
413
+ printf ("%s, VMX can not be enabled\n" , __func__ );
414
414
ret = - ENODEV ;
415
415
} else if (get_pcpu_nums () > CONFIG_MAX_PCPU_NUM ) {
416
- pr_fatal ("%s, pcpu number(%d) is out of range\n" , __func__ , get_pcpu_nums ());
416
+ printf ("%s, pcpu number(%d) is out of range\n" , __func__ , get_pcpu_nums ());
417
+ ret = - ENODEV ;
418
+ } else if (!pcpu_has_cap (X86_FEATURE_X2APIC )) {
419
+ printf ("%s, x2APIC not supported\n" , __func__ );
417
420
ret = - ENODEV ;
418
421
} else {
419
422
ret = check_vmx_mmu_cap ();
420
- if (ret == 0 ) {
421
- pr_acrnlog ("hardware support HV" );
422
- }
423
423
}
424
424
425
425
return ret ;
0 commit comments