1 IMPLEMENTATION [vmx && svm]:
8 #include "vm_vmx_ept.h"
11 template< typename VM >
13 Vm_factory::allocate(Ram_quota *quota)
15 if (void *t = Vm::allocator<VM>()->q_alloc(quota))
17 VM *a = new (t) VM(quota);
29 Vm_factory::create(Ram_quota *quota, int *err)
31 *err = -L4_err::ENomem;
32 if (Svm::cpus.current().svm_enabled())
33 return allocate<Vm_svm>(quota);
34 if (Vmx::cpus.current().vmx_enabled())
36 if (Vmx::cpus.current().info.procbased_ctls2.allowed(Vmx::PRB2_enable_ept))
37 return allocate<Vm_vmx_ept>(quota);
39 return allocate<Vm_vmx>(quota);
41 *err = L4_err::ENodev;