Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 02:43, Chen, Tiejun wrote: >> >> +default: >> +WARN_ON(1); >> +continue; > > 'continue' versus 'break'? Yes, it avoids falling through to "vmcs12_write_any(>vcpu, field, field_value)". > Looks we're missing another place, Right, thanks. Paolo

Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-05 Thread Paolo Bonzini
On 05/11/2014 02:43, Chen, Tiejun wrote: +default: +WARN_ON(1); +continue; 'continue' versus 'break'? Yes, it avoids falling through to vmcs12_write_any(vmx-vcpu, field, field_value). Looks we're missing another place, Right, thanks. Paolo -- To

Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-04 Thread Chen, Tiejun
On 2014/11/5 9:43, Chen, Tiejun wrote: On 2014/11/5 1:33, Paolo Bonzini wrote: Return a negative error code instead, and WARN() when we should be covering the entire 2-bit space of vmcs_field_type's return value. For increased robustness, add a BUILD_BUG_ON checking the range of

Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-04 Thread Chen, Tiejun
On 2014/11/5 1:33, Paolo Bonzini wrote: Return a negative error code instead, and WARN() when we should be covering the entire 2-bit space of vmcs_field_type's return value. For increased robustness, add a BUILD_BUG_ON checking the range of vmcs_field_to_offset. Suggested-by: Tiejun Chen

[PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-04 Thread Paolo Bonzini
Return a negative error code instead, and WARN() when we should be covering the entire 2-bit space of vmcs_field_type's return value. For increased robustness, add a BUILD_BUG_ON checking the range of vmcs_field_to_offset. Suggested-by: Tiejun Chen Signed-off-by: Paolo Bonzini ---

[PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-04 Thread Paolo Bonzini
Return a negative error code instead, and WARN() when we should be covering the entire 2-bit space of vmcs_field_type's return value. For increased robustness, add a BUILD_BUG_ON checking the range of vmcs_field_to_offset. Suggested-by: Tiejun Chen tiejun.c...@intel.com Signed-off-by: Paolo

Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-04 Thread Chen, Tiejun
On 2014/11/5 1:33, Paolo Bonzini wrote: Return a negative error code instead, and WARN() when we should be covering the entire 2-bit space of vmcs_field_type's return value. For increased robustness, add a BUILD_BUG_ON checking the range of vmcs_field_to_offset. Suggested-by: Tiejun Chen

Re: [PATCH] kvm: x86: vmx: avoid returning bool to distinguish success from error

2014-11-04 Thread Chen, Tiejun
On 2014/11/5 9:43, Chen, Tiejun wrote: On 2014/11/5 1:33, Paolo Bonzini wrote: Return a negative error code instead, and WARN() when we should be covering the entire 2-bit space of vmcs_field_type's return value. For increased robustness, add a BUILD_BUG_ON checking the range of