MCPcopy Create free account
hub / github.com/HoShiMin/Kernel-Bridge / Virtualize

Function Virtualize

Kernel-Bridge/API/Hypervisor.cpp:2744–2773  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2742 }
2743
2744 bool Virtualize()
2745 {
2746#ifdef _AMD64_
2747 if (IsVirtualized()) return false;
2748
2749 CPU_VENDOR CpuVendor = GetCpuVendor();
2750 if (CpuVendor == CPU_VENDOR::cpuUnknown) return false;
2751
2752 bool Status = false;
2753
2754 switch (CpuVendor) {
2755 case CPU_VENDOR::cpuIntel:
2756 {
2757 if (!VMX::IsVmxSupported()) return false;
2758 Status = VMX::VirtualizeAllProcessors();
2759 break;
2760 }
2761 case CPU_VENDOR::cpuAmd:
2762 {
2763 if (!SVM::IsSvmSupported()) return false;
2764 Status = SVM::VirtualizeAllProcessors();
2765 break;
2766 }
2767 }
2768
2769 return Status;
2770#else
2771 return false;
2772#endif
2773 }
2774
2775 bool Devirtualize()
2776 {

Callers 2

OnSystemWakeFunction · 0.85
KbVmmEnableFunction · 0.85

Calls 5

IsVirtualizedFunction · 0.85
GetCpuVendorFunction · 0.85
IsVmxSupportedFunction · 0.85
VirtualizeAllProcessorsFunction · 0.85
IsSvmSupportedFunction · 0.85

Tested by

no test coverage detected