uint_t vm_cr_low = 0, vm_cr_high = 0;
- return 1;
if ((ret & CPUID_FEATURE_IDS_ecx_svm_avail) == 0) {
PrintDebug("SVM Not Available\n");
return 0;
-void Init_SVM() {
+void Init_SVM(struct vmm_ctrl_ops * vmm_ops) {
reg_ex_t msr;
void * host_state;
- // setup
+ // Enable SVM on the CPU
Get_MSR(EFER_MSR, &(msr.e_reg.high), &(msr.e_reg.low));
msr.e_reg.low |= EFER_MSR_svm_enable;
Set_MSR(EFER_MSR, 0, msr.e_reg.low);
Set_MSR(SVM_VM_HSAVE_PA_MSR, msr.e_reg.high, msr.e_reg.low);
+
+ // Setup the SVM specific vmm operations
+ vmm_ops->init_guest = &init_svm_guest;
+ vmm_ops->start_guest = &start_svm_guest;
+
+
return;
}
+/**
+ * We handle the svm exits here
+ * This function should probably be moved to another file to keep things managable....
+ */
+int handle_svm_exit(struct VMM_GPRs guest_gprs) {
+
+ return 0;
+}
+
+
vmcb_t * Allocate_VMCB() {
vmcb_t * vmcb_page = (vmcb_t*)os_hooks->Allocate_Pages(1);