Re: [PATCH 08/10] KVM: nVMX: Rename exit_reason to vm_exit_reason for nested VM-Exit

From: Sean Christopherson
Date: Fri Mar 13 2020 - 12:17:12 EST


On Fri, Mar 13, 2020 at 03:01:55PM +0100, Vitaly Kuznetsov wrote:
> Sean Christopherson <sean.j.christopherson@xxxxxxxxx> writes:
>
> > Use "vm_exit_reason" when passing around the full exit reason for nested
> > VM-Exits to make it clear that it's not just the basic exit reason. The
> > basic exit reason (bits 15:0 of vmcs.VM_EXIT_REASON) is colloquially
> > referred to as simply "exit reason", e.g. vmx_handle_vmexit() tracks the
> > basic exit reason in a local variable named "exit_reason".
> >
>
> Would it make sense to stop using 'exit_reason' without a prefix (full,
> basic,...) completely?

I'd prefer to keep using exit_reason as a local variable. Either that or
grab the whole union locally and use "exit_reason.basic".

IMO, referring to the basic exit reason as simply "exit reason" is so
pervasive that it's reasonable to use exit_reason as a local variable.