On Tue, Jul 28, 2020 at 12:10:48AM +0000, Krish Sadhukhan wrote: > The names of some of the vmx_x86_ops functions do not have a corresponding > 'vmx_' prefix. Generate the names using a macro so that the names are > conformant. Fixing the naming will help in better readability and > maintenance of the code. > > Suggested-by: Vitaly Kuznetsov <vkuznets@xxxxxxxxxx> > Suggested-by: Paolo Bonzini <pbonzini@xxxxxxxxxx> > Signed-off-by: Sean Christopherson <sean.j.christopherson@xxxxxxxxx> > Signed-off-by: Krish Sadhukhan <krish.sadhukhan@xxxxxxxxxx> > --- > arch/x86/kvm/vmx/nested.c | 2 +- > arch/x86/kvm/vmx/vmx.c | 234 +++++++++++++++++++++++----------------------- > arch/x86/kvm/vmx/vmx.h | 2 +- > 3 files changed, 120 insertions(+), 118 deletions(-) > > diff --git a/arch/x86/kvm/vmx/nested.c b/arch/x86/kvm/vmx/nested.c > index d1af20b..a898b53 100644 > --- a/arch/x86/kvm/vmx/nested.c > +++ b/arch/x86/kvm/vmx/nested.c > @@ -3016,7 +3016,7 @@ static int nested_vmx_check_vmentry_hw(struct kvm_vcpu *vcpu) > > preempt_disable(); > > - vmx_prepare_switch_to_guest(vcpu); > + vmx_prepare_guest_switch(vcpu); I very strongly prefer the VMX version, i.e. rename kvm_x86_ops.prepare_guest_switch() instead of renamed vmx_prepare_switch_to_guest(). prepare_guest_switch() can be misinterpreted as switching to a different guest, and vmx_prepare_switch_to_guest() explicitly pairs with vmx_prepare_switch_to_host(). > > /* > * Induce a consistency check VMExit by clearing bit 1 in GUEST_RFLAGS,