lkml.org 
[lkml]   [2019]   [Sep]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 15/17] KVM: retpolines: x86: eliminate retpoline from vmx.c exit handlers
On Tue, Sep 24, 2019 at 02:15:39AM +0200, Paolo Bonzini wrote:
> On 23/09/19 22:23, Sean Christopherson wrote:
> >
> > +int nested_vmx_handle_vmx_instruction(struct kvm_vcpu *vcpu)
> > +{
> > + switch (to_vmx(vcpu)->exit_reason) {
> > + case EXIT_REASON_VMCLEAR:
> > + return handle_vmclear(vcpu);
> > + case EXIT_REASON_VMLAUNCH:
> > + return handle_vmlaunch(vcpu);
> > + case EXIT_REASON_VMPTRLD:
> > + return handle_vmptrld(vcpu);
> > + case EXIT_REASON_VMPTRST:
> > + return handle_vmptrst(vcpu);
> > + case EXIT_REASON_VMREAD:
> > + return handle_vmread(vcpu);
> > + case EXIT_REASON_VMRESUME:
> > + return handle_vmresume(vcpu);
> > + case EXIT_REASON_VMWRITE:
> > + return handle_vmwrite(vcpu);
> > + case EXIT_REASON_VMOFF:
> > + return handle_vmoff(vcpu);
> > + case EXIT_REASON_VMON:
> > + return handle_vmon(vcpu);
> > + case EXIT_REASON_INVEPT:
> > + return handle_invept(vcpu);
> > + case EXIT_REASON_INVVPID:
> > + return handle_invvpid(vcpu);
> > + case EXIT_REASON_VMFUNC:
> > + return handle_vmfunc(vcpu);
> > + }
> > +
>
> Do you really need that? Why couldn't the handle_* functions simply be
> exported from nested.c to vmx.c?

Nope, just personal preference to keep the nested code as isolated as
possible. We use a similar approach for vmx_{g,s}et_vmx_msr().

Though if we do want to go this route, it'd be better to simply move
handle_vmx_instruction() to nested.c instead of bouncing through that
and nested_vmx_handle_vmx_instruction().

\
 
 \ /
  Last update: 2019-09-24 02:46    [W:0.080 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site