X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fsvm.c;h=77653af8f0733524d5d8495846c652ea5909b735;hp=95bb5867534cbb089f6c9cc4862e36dcc2fd0f8e;hb=9dc62167c8f74a37391028c558f46db50a7998d1;hpb=5c6233eb88fe33c60907d72e8b5d8b13d4084a9e diff --git a/palacios/src/palacios/svm.c b/palacios/src/palacios/svm.c index 95bb586..77653af 100644 --- a/palacios/src/palacios/svm.c +++ b/palacios/src/palacios/svm.c @@ -59,7 +59,7 @@ static vmcb_t * Allocate_VMCB() { - +#include static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { vmcb_ctrl_t * ctrl_area = GET_VMCB_CTRL_AREA(vmcb); @@ -77,7 +77,21 @@ static void Init_VMCB_BIOS(vmcb_t * vmcb, struct guest_info *vm_info) { ctrl_area->cr_reads.cr0 = 1; ctrl_area->cr_writes.cr0 = 1; + + /* Set up the efer to enable 64 bit page tables */ + { + struct efer_64 * efer = (struct efer_64 *)&(guest_state->efer); + struct cr4_32 * cr4 = (struct cr4_32 *)&(guest_state->cr4); + efer->lma = 1; + efer->lme = 1; + + cr4->pae = 1; + } + guest_state->efer |= EFER_MSR_svm_enable; + + + guest_state->rflags = 0x00000002; // The reserved bit is always 1 ctrl_area->svm_instrs.VMRUN = 1; ctrl_area->svm_instrs.VMMCALL = 1;