X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmx_hw_info.c;h=478bfbc54efdef862a9d0920b65d6a15c5812838;hb=1f9fa9cd9662a600f49a3b12fcc02fd2ffca93c8;hp=3220e526b141c58264eb2c3e209433fbeb4b5021;hpb=a233b06933d916e4767aa1186568c917df19a8a3;p=palacios.git diff --git a/palacios/src/palacios/vmx_hw_info.c b/palacios/src/palacios/vmx_hw_info.c index 3220e52..478bfbc 100644 --- a/palacios/src/palacios/vmx_hw_info.c +++ b/palacios/src/palacios/vmx_hw_info.c @@ -25,9 +25,19 @@ // Intel VMX Feature MSRs +uint32_t v3_vmx_get_ctrl_features(struct vmx_ctrl_field * fields) { + // features are available if they are hardwired to 1, or the mask is 0 (they can be changed) + uint32_t features = 0; + + features = fields->req_val; + features |= ~(fields->req_mask); + + return features; +} + static int get_ex_ctrl_caps(struct vmx_hw_info * hw_info, struct vmx_ctrl_field * field, - uint32_t old_msr, uint32_t true_msr) { + uint32_t old_msr, uint32_t true_msr) { uint32_t old_0; /* Bit is 1 => MB1 */ uint32_t old_1; /* Bit is 0 => MBZ */ uint32_t true_0; /* Bit is 1 => MB1 */ @@ -103,7 +113,7 @@ int v3_init_vmx_hw(struct vmx_hw_info * hw_info) { /* Intel Manual 3B. Sect. G.3.3 */ if ( ((hw_info->proc_ctrls.req_mask & 0x80000000) == 0) || ((hw_info->proc_ctrls.req_val & 0x80000000) == 1) ) { - get_ctrl_caps(&(hw_info->proc_ctrls_2), VMX_PROCBASED_CTLS2_MSR); + get_ctrl_caps(&(hw_info->sec_proc_ctrls), VMX_PROCBASED_CTLS2_MSR); } get_cr_fields(&(hw_info->cr0), VMX_CR0_FIXED1_MSR, VMX_CR0_FIXED0_MSR);