def check_vmx_pt():
from fcntl import ioctl
KVMIO = 0xAE
KVM_VMX_PT_SUPPORTED = KVMIO << (8) | 0xe4
try:
fd = open("/dev/kvm", "wb")
except:
print('\033[91m' + error_prefix + "KVM is not loaded!" + '\033[0m')
return False
try:
ret = ioctl(fd, KVM_VMX_PT_SUPPORTED, 0)
except IOError:
print('\033[91m' + error_prefix + "VMX_PT is not loaded!" + '\033[0m')
return False
fd.close()
if ret == 0:
print('\033[91m' + error_prefix + "Intel PT is not supported on this CPU!" + '\033[0m')
return False
return True
评论列表
文章目录