VMM: fixes VMCS order computation
authorBarret Rhoden <brho@cs.berkeley.edu>
Fri, 20 Mar 2015 21:22:23 +0000 (17:22 -0400)
committerBarret Rhoden <brho@cs.berkeley.edu>
Tue, 7 Apr 2015 19:06:58 +0000 (15:06 -0400)
Shifting gives us 0 for nr pages, though we want 1.  And the LOG2 of
that spits out 1 for the order.  We wanted order 0 (1 page).

kern/arch/x86/vmm/intel/vmx.c

index 0388c25..8f82292 100644 (file)
@@ -573,7 +573,7 @@ static  void setup_vmcs_config(void *p)
        }
 
        vmcs_conf->size = vmx_msr_high & 0x1fff;
-       vmcs_conf->order = LOG2_UP(vmcs_config.size>> PAGE_SHIFT);
+       vmcs_conf->order = LOG2_UP(nr_pages(vmcs_config.size));
        vmcs_conf->revision_id = vmx_msr_low;
        printk("vmcs_conf size %d order %d rev %d\n",
               vmcs_conf->size, vmcs_conf->order,