2 * This file is part of the Palacios Virtual Machine Monitor developed
3 * by the V3VEE Project with funding from the United States National
4 * Science Foundation and the Department of Energy.
6 * The V3VEE Project is a joint project between Northwestern University
7 * and the University of New Mexico. You can find out more at
10 * Copyright (c) 2011, Jack Lange <jarusl@cs.northwestern.edu>
11 * Copyright (c) 2011, The V3VEE Project <http://www.v3vee.org>
12 * All rights reserved.
14 * Author: Jack Lange <jarusl@cs.northwestern.edu>
16 * This is free software. You are permitted to use,
17 * redistribute, and modify it as specified in the file "V3VEE_LICENSE".
20 #include <palacios/vmm.h>
21 #include <palacios/vmm_lowlevel.h>
22 #include <palacios/vmx_hw_info.h>
25 // Intel VMX Feature MSRs
27 #define VMX_BASIC_MSR 0x00000480
28 #define VMX_PINBASED_CTLS_MSR 0x00000481
29 #define VMX_PROCBASED_CTLS_MSR 0x00000482
30 #define VMX_EXIT_CTLS_MSR 0x00000483
31 #define VMX_ENTRY_CTLS_MSR 0x00000484
32 #define VMX_MISC_MSR 0x00000485
33 #define VMX_CR0_FIXED0_MSR 0x00000486
34 #define VMX_CR0_FIXED1_MSR 0x00000487
35 #define VMX_CR4_FIXED0_MSR 0x00000488
36 #define VMX_CR4_FIXED1_MSR 0x00000489
37 #define VMX_VMCS_ENUM_MSR 0x0000048A
45 int v3_init_vmx_hw(struct vmx_hw_info * hw_info) {
46 // extern v3_cpu_arch_t v3_cpu_types[];
48 memset(hw_info, 0, sizeof(struct vmx_hw_info));
50 v3_get_msr(VMX_BASIC_MSR, &(hw_info->basic_info.hi), &(hw_info->basic_info.lo));
55 if (has_vmx_nested_paging() == 1) {
56 v3_cpu_types[cpu_id] = V3_VMX_EPT_CPU;
58 v3_cpu_types[cpu_id] = V3_VMX_CPU;