X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm.c;h=1571c4871fc966941ad869315659fd2173a5e2ba;hb=28cfe68985ef4360c9bd7428a19c222b295e9d85;hp=fcc6ea55be17391534bff62893118e1018c58b61;hpb=068d7e66db537f981fde19a098a12e4390fa3de4;p=palacios.git diff --git a/palacios/src/palacios/vmm.c b/palacios/src/palacios/vmm.c index fcc6ea5..1571c48 100644 --- a/palacios/src/palacios/vmm.c +++ b/palacios/src/palacios/vmm.c @@ -174,9 +174,17 @@ void v3_yield_cond(struct guest_info * info) { } } +/* + * unconditional cpu yield + * if the yielding thread is a guest context, the guest quantum is reset on resumption + * Non guest context threads should call this function with a NULL argument + */ void v3_yield(struct guest_info * info) { V3_Yield(); - rdtscll(info->yield_start_cycle); + + if (info) { + rdtscll(info->yield_start_cycle); + } } @@ -188,3 +196,25 @@ void v3_interrupt_cpu(struct guest_info * info, int logical_cpu) { (os_hooks)->interrupt_cpu(info, logical_cpu); } } + + + +int v3_vm_enter(struct guest_info * info) { + switch (v3_cpu_types[info->cpu_id]) { +#ifdef CONFIG_SVM + case V3_SVM_CPU: + case V3_SVM_REV3_CPU: + return v3_svm_enter(info); + break; +#endif +#if CONFIG_VMX && 0 + case V3_VMX_CPU: + case V3_VMX_EPT_CPU: + return v3_vmx_enter(info); + break; +#endif + default: + PrintError("Attemping to enter a guest on an invalid CPU\n"); + return -1; + } +}