- Timestamp:
- Oct 31, 2023 9:22:10 AM (16 months ago)
- svn:sync-xref-src-repo-rev:
- 159763
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/ValidationKit/testboxscript/TestBoxHelper.cpp
r100108 r101672 381 381 } 382 382 RTPrintf("\n"); 383 #else 384 #endif 383 385 384 386 /* … … 406 408 } 407 409 RTPrintf("\n"); 408 409 #else410 #endif411 410 412 411 /* … … 471 470 } 472 471 473 typedef enum { HWVIRTTYPE_NONE, HWVIRTTYPE_VTX, HWVIRTTYPE_AMDV } HWVIRTTYPE;472 typedef enum { HWVIRTTYPE_NONE, HWVIRTTYPE_VTX, HWVIRTTYPE_AMDV, HVIRTTYPE_ARMV8 } HWVIRTTYPE; 474 473 static HWVIRTTYPE isHwVirtSupported(void) 475 474 { … … 494 493 return HWVIRTTYPE_AMDV; 495 494 } 495 #elif defined(RT_ARCH_ARM64) 496 # if defined(RT_OS_DARWIN) 497 /* 498 * The kern.hv_support parameter indicates support for the hypervisor API in the 499 * kernel, which is the only way for virtualization on macOS on Apple Silicon. 500 */ 501 int32_t fHvSupport = 0; 502 size_t cbOld = sizeof(fHvSupport); 503 if (sysctlbyname("kern.hv_support", &fHvSupport, &cbOld, NULL, 0) == 0) 504 { 505 if (fHvSupport != 0) 506 return HVIRTTYPE_ARMV8; 507 } 508 # endif 496 509 #endif 497 510 … … 515 528 int fSupported = -1; 516 529 530 HWVIRTTYPE enmHwVirt = isHwVirtSupported(); 517 531 #if defined(RT_ARCH_AMD64) || defined(RT_ARCH_X86) 518 HWVIRTTYPE enmHwVirt = isHwVirtSupported();519 532 if (enmHwVirt == HWVIRTTYPE_AMDV) 520 533 { … … 595 608 } 596 609 # endif 610 #elif defined(RT_ARCH_ARM64) 611 /* On ARM nested paging is always supported if virtualization is there. */ 612 if (enmHwVirt == HVIRTTYPE_ARMV8) 613 fSupported = 1; 597 614 #endif 598 615 … … 648 665 } 649 666 } 667 #elif defined(RT_ARCH_ARM64) 668 fSupported = 1; /** @todo LongMode is a misnomer here but in general means 64-bit guest capable. */ 650 669 #endif 651 670 } … … 708 727 ASMCpuId(0, &uEax, &uEbx, &uEcx, &uEdx); 709 728 int cch = RTPrintf("%.04s%.04s%.04s\n", &uEbx, &uEdx, &uEcx); 729 #elif defined(RT_ARCH_ARM64) && defined(RT_OS_DARWIN) 730 /* 731 * There is machdep.cpu.brand_string we could query but that identifies 732 * the whole CPU and not just the vendor. 733 * 734 * Running on macOS using the arm64 architecture is a pretty safe bet that 735 * we are also running on Apple Silicon (there is the possibility that 736 * this runs in a macOS VM on some other hardware but this is highly unlikely). 737 */ 738 int cch = RTPrintf("Apple\n"); 710 739 #else 711 740 int cch = RTPrintf("%s\n", RTBldCfgTargetArch());
Note:
See TracChangeset
for help on using the changeset viewer.