Re: [PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-25 Thread Paolo Bonzini
On 25/09/2017 15:02, Wei Wang wrote: > On 09/25/2017 07:54 PM, Paolo Bonzini wrote: >> On 25/09/2017 06:44, Wei Wang wrote: >>>   +static void update_msr_autoload_count_max(void) >>> +{ >>> +    u64 vmx_msr; >>> +    int n; >>> + >>> +    /* >>> + * According to the Intel SDM, if Bits 27:25 of

Re: [PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-25 Thread Paolo Bonzini
On 25/09/2017 15:02, Wei Wang wrote: > On 09/25/2017 07:54 PM, Paolo Bonzini wrote: >> On 25/09/2017 06:44, Wei Wang wrote: >>>   +static void update_msr_autoload_count_max(void) >>> +{ >>> +    u64 vmx_msr; >>> +    int n; >>> + >>> +    /* >>> + * According to the Intel SDM, if Bits 27:25 of

Re: [PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-25 Thread Wei Wang
On 09/25/2017 07:54 PM, Paolo Bonzini wrote: On 25/09/2017 06:44, Wei Wang wrote: +static void update_msr_autoload_count_max(void) +{ + u64 vmx_msr; + int n; + + /* +* According to the Intel SDM, if Bits 27:25 of MSR_IA32_VMX_MISC is +* n, then (n + 1) * 512

Re: [PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-25 Thread Wei Wang
On 09/25/2017 07:54 PM, Paolo Bonzini wrote: On 25/09/2017 06:44, Wei Wang wrote: +static void update_msr_autoload_count_max(void) +{ + u64 vmx_msr; + int n; + + /* +* According to the Intel SDM, if Bits 27:25 of MSR_IA32_VMX_MISC is +* n, then (n + 1) * 512

Re: [PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-25 Thread Paolo Bonzini
On 25/09/2017 06:44, Wei Wang wrote: > > +static void update_msr_autoload_count_max(void) > +{ > + u64 vmx_msr; > + int n; > + > + /* > + * According to the Intel SDM, if Bits 27:25 of MSR_IA32_VMX_MISC is > + * n, then (n + 1) * 512 is the recommended max number of MSRs to

Re: [PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-25 Thread Paolo Bonzini
On 25/09/2017 06:44, Wei Wang wrote: > > +static void update_msr_autoload_count_max(void) > +{ > + u64 vmx_msr; > + int n; > + > + /* > + * According to the Intel SDM, if Bits 27:25 of MSR_IA32_VMX_MISC is > + * n, then (n + 1) * 512 is the recommended max number of MSRs to

[PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-24 Thread Wei Wang
This patch clarifies a vague statement in the SDM: the recommended maximum number of MSRs that can be automically switched by CPU during VMExit and VMEntry is 512, rather than 512 Bytes of MSRs. Depending on the CPU implementations, it may also support more than 512 MSRs to be auto switched. This

[PATCH v1 1/4] KVM/vmx: re-write the msr auto switch feature

2017-09-24 Thread Wei Wang
This patch clarifies a vague statement in the SDM: the recommended maximum number of MSRs that can be automically switched by CPU during VMExit and VMEntry is 512, rather than 512 Bytes of MSRs. Depending on the CPU implementations, it may also support more than 512 MSRs to be auto switched. This