Re: [PATCH v3 2/9] KVM: x86: Move init-only kvm_x86_ops to separate struct

2020-03-24 Thread Vitaly Kuznetsov
Sean Christopherson writes: > On Mon, Mar 23, 2020 at 01:10:40PM +0100, Vitaly Kuznetsov wrote: >> Sean Christopherson writes: >> >> > + >> > + .runtime_ops = _x86_ops, >> > +}; >> >> Unrelated to your patch but I think we can make the naming of some of >> these functions more consistend on

Re: [PATCH v3 2/9] KVM: x86: Move init-only kvm_x86_ops to separate struct

2020-03-23 Thread Paolo Bonzini
On 23/03/20 17:24, Vitaly Kuznetsov wrote: > Sounds cool! (not sure that with only two implementations people won't > call it 'over-engineered' but cool). Yes, something like #define KVM_X86_OP(name) .name = vmx_##name (svm_##name for svm.c) and then KVM_X86_OP(check_nested_events)

Re: [PATCH v3 2/9] KVM: x86: Move init-only kvm_x86_ops to separate struct

2020-03-23 Thread Sean Christopherson
On Mon, Mar 23, 2020 at 05:24:56PM +0100, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > > On Mon, Mar 23, 2020 at 01:10:40PM +0100, Vitaly Kuznetsov wrote: > >> Sean Christopherson writes: > >> > >> > + > >> > +.runtime_ops = _x86_ops, > >> > +}; > >> > >> Unrelated to

Re: [PATCH v3 2/9] KVM: x86: Move init-only kvm_x86_ops to separate struct

2020-03-23 Thread Sean Christopherson
On Mon, Mar 23, 2020 at 01:10:40PM +0100, Vitaly Kuznetsov wrote: > Sean Christopherson writes: > > > + > > + .runtime_ops = _x86_ops, > > +}; > > Unrelated to your patch but I think we can make the naming of some of > these functions more consistend on SVM/VMX, in particular I'd suggest >

Re: [PATCH v3 2/9] KVM: x86: Move init-only kvm_x86_ops to separate struct

2020-03-23 Thread Vitaly Kuznetsov
Sean Christopherson writes: > Move the kvm_x86_ops functions that are used only within the scope of > kvm_init() into a separate struct, kvm_x86_init_ops. In addition to > identifying the init-only functions without restorting to code comments, > this also sets the stage for waiting until after

[PATCH v3 2/9] KVM: x86: Move init-only kvm_x86_ops to separate struct

2020-03-21 Thread Sean Christopherson
Move the kvm_x86_ops functions that are used only within the scope of kvm_init() into a separate struct, kvm_x86_init_ops. In addition to identifying the init-only functions without restorting to code comments, this also sets the stage for waiting until after ->hardware_setup() to set