|
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v4 3/7] x86/msr: read VMX MSRs values into Raw policy
>>> On 18.10.17 at 10:27, <sergey.dyasli@xxxxxxxxxx> wrote:
> --- a/xen/arch/x86/msr.c
> +++ b/xen/arch/x86/msr.c
> @@ -32,6 +32,37 @@ struct msr_domain_policy __read_mostly
> raw_msr_domain_policy,
> struct msr_vcpu_policy __read_mostly hvm_max_msr_vcpu_policy,
> __read_mostly pv_max_msr_vcpu_policy;
>
> +static void __init calculate_raw_vmx_policy(struct msr_domain_policy *dp)
> +{
> + unsigned int i;
> +
> + if ( !cpu_has_vmx )
> + return;
> +
> + for ( i = MSR_IA32_VMX_BASIC; i <= MSR_IA32_VMX_VMCS_ENUM; i++ )
> + rdmsrl(i, dp->vmx.raw[i - MSR_IA32_VMX_BASIC]);
> +
> + if ( dp->vmx.procbased_ctls.allowed_1.activate_secondary_controls )
> + {
> + rdmsrl(MSR_IA32_VMX_PROCBASED_CTLS2, dp->vmx_procbased_ctls2.raw);
> +
> + if ( dp->vmx_procbased_ctls2.allowed_1.enable_ept ||
> + dp->vmx_procbased_ctls2.allowed_1.enable_vpid )
> + rdmsrl(MSR_IA32_VMX_EPT_VPID_CAP, dp->vmx_ept_vpid_cap.raw);
For consistency please either move this out of the if() or ...
> + }
> +
> + if ( dp->vmx.basic.default1_zero )
> + {
> + for ( i = MSR_IA32_VMX_TRUE_PINBASED_CTLS;
> + i <= MSR_IA32_VMX_TRUE_ENTRY_CTLS; i++ )
> + rdmsrl(i,
> + dp->vmx_true_ctls.raw[i -
> MSR_IA32_VMX_TRUE_PINBASED_CTLS]);
> + }
> +
> + if ( dp->vmx_procbased_ctls2.allowed_1.enable_vm_functions )
> + rdmsrl(MSR_IA32_VMX_VMFUNC, dp->vmx_vmfunc.raw);
... move this one into that same if() above.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |