Re: [PATCH 5/5] KVM: x86: Set kvm_x86_ops only after ->hardware_setup() completes

2020-01-31 Thread Sean Christopherson
On Thu, Jan 30, 2020 at 06:44:09AM +0100, Paolo Bonzini wrote: > On 30/01/20 01:10, Sean Christopherson wrote: > > Set kvm_x86_ops with the vendor's ops only after ->hardware_setup() > > completes to "prevent" using kvm_x86_ops before they are ready, i.e. to > > generate a null pointer fault

Re: [PATCH 5/5] KVM: x86: Set kvm_x86_ops only after ->hardware_setup() completes

2020-01-29 Thread Paolo Bonzini
On 30/01/20 01:10, Sean Christopherson wrote: > Set kvm_x86_ops with the vendor's ops only after ->hardware_setup() > completes to "prevent" using kvm_x86_ops before they are ready, i.e. to > generate a null pointer fault instead of silently consuming unconfigured > state. What about even copying

[PATCH 5/5] KVM: x86: Set kvm_x86_ops only after ->hardware_setup() completes

2020-01-29 Thread Sean Christopherson
Set kvm_x86_ops with the vendor's ops only after ->hardware_setup() completes to "prevent" using kvm_x86_ops before they are ready, i.e. to generate a null pointer fault instead of silently consuming unconfigured state. An alternative implementation would be to have ->hardware_setup() return the