Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-28 Thread Paolo Bonzini
Il 21/04/2014 21:20, Bandan Das ha scritto: We track shadow vmcs fields through two static lists, one for read only and another for r/w fields. However, with addition of new vmcs fields, not all fields may be supported on all hosts. If so, copy_vmcs12_to_shadow() trying to vmwrite on

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-28 Thread Paolo Bonzini
Il 21/04/2014 21:20, Bandan Das ha scritto: We track shadow vmcs fields through two static lists, one for read only and another for r/w fields. However, with addition of new vmcs fields, not all fields may be supported on all hosts. If so, copy_vmcs12_to_shadow() trying to vmwrite on

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-26 Thread Paolo Bonzini
Il 22/04/2014 21:31, Bandan Das ha scritto: Paolo Bonzini writes: Il 22/04/2014 12:25, Bandan Das ha scritto: + if (j < i) + shadow_read_write_fields[j] = + shadow_read_write_fields[i]; + j++; ... you need to

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-26 Thread Paolo Bonzini
Il 22/04/2014 21:31, Bandan Das ha scritto: Paolo Bonzini pbonz...@redhat.com writes: Il 22/04/2014 12:25, Bandan Das ha scritto: + if (j i) + shadow_read_write_fields[j] = + shadow_read_write_fields[i]; + j++;

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-22 Thread Bandan Das
Paolo Bonzini writes: > Il 22/04/2014 12:25, Bandan Das ha scritto: >> + if (j < i) >> + shadow_read_write_fields[j] = >> + shadow_read_write_fields[i]; >> + j++; >>> > >>> > ... you need to

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-22 Thread Paolo Bonzini
Il 22/04/2014 12:25, Bandan Das ha scritto: >> + if (j < i) >> + shadow_read_write_fields[j] = >> + shadow_read_write_fields[i]; >> + j++; > > ... you need to respin anyway because the j++ is wrong. It should be >

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-22 Thread Bandan Das
Paolo Bonzini writes: > Il 21/04/2014 15:20, Bandan Das ha scritto: >> +for (i = j = 0; i < max_shadow_read_write_fields; i++) { >> + > > Extra empty line. Not a big deal, but... > >> +switch (shadow_read_write_fields[i]) { >> +case GUEST_BNDCFGS: >> +

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-22 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: Il 21/04/2014 15:20, Bandan Das ha scritto: +for (i = j = 0; i max_shadow_read_write_fields; i++) { + Extra empty line. Not a big deal, but... +switch (shadow_read_write_fields[i]) { +case GUEST_BNDCFGS: +

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-22 Thread Paolo Bonzini
Il 22/04/2014 12:25, Bandan Das ha scritto: + if (j i) + shadow_read_write_fields[j] = + shadow_read_write_fields[i]; + j++; ... you need to respin anyway because the j++ is wrong. It should be inside the if.

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-22 Thread Bandan Das
Paolo Bonzini pbonz...@redhat.com writes: Il 22/04/2014 12:25, Bandan Das ha scritto: + if (j i) + shadow_read_write_fields[j] = + shadow_read_write_fields[i]; + j++; ... you need to respin anyway

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-21 Thread Paolo Bonzini
Il 21/04/2014 15:20, Bandan Das ha scritto: + for (i = j = 0; i < max_shadow_read_write_fields; i++) { + Extra empty line. Not a big deal, but... + switch (shadow_read_write_fields[i]) { + case GUEST_BNDCFGS: + if

[PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-21 Thread Bandan Das
We track shadow vmcs fields through two static lists, one for read only and another for r/w fields. However, with addition of new vmcs fields, not all fields may be supported on all hosts. If so, copy_vmcs12_to_shadow() trying to vmwrite on unsupported hosts will result in a vmwrite error. For

[PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-21 Thread Bandan Das
We track shadow vmcs fields through two static lists, one for read only and another for r/w fields. However, with addition of new vmcs fields, not all fields may be supported on all hosts. If so, copy_vmcs12_to_shadow() trying to vmwrite on unsupported hosts will result in a vmwrite error. For

Re: [PATCH v2] KVM: x86: Check for host supported fields in shadow vmcs

2014-04-21 Thread Paolo Bonzini
Il 21/04/2014 15:20, Bandan Das ha scritto: + for (i = j = 0; i max_shadow_read_write_fields; i++) { + Extra empty line. Not a big deal, but... + switch (shadow_read_write_fields[i]) { + case GUEST_BNDCFGS: + if (!vmx_mpx_supported())