[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 2/4] x86/svm: Don't shadow variables in svm_vmexit_handler()



On 04.12.2019 10:43, Andrew Cooper wrote:
> The local variable eventinj is set to the value of vmcb->exitintinfo which is
> confusing considering that it isn't vmcb->eventinj.  The variable isn't
> necessary to begin with, so drop it to avoid confusion.
> 
> A local rc variable is shadowed in the CPUID, #DB and #BP handlers.
> 
> There is a mix of spelling of inst_len and insn_len, all of which are
> logically the same value.  Consolidate on insn_len which also matches the name
> of the emulation functions for obtaining instruction lengths, and avoid
> shadowing it in the CPUID and TASK_SWITCH handlers.
> 
> Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>

Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx>

> --- a/xen/arch/x86/hvm/svm/svm.c
> +++ b/xen/arch/x86/hvm/svm/svm.c
> @@ -2480,8 +2480,7 @@ void svm_vmexit_handler(struct cpu_user_regs *regs)
>      uint64_t exit_reason;
>      struct vcpu *v = current;
>      struct vmcb_struct *vmcb = v->arch.hvm.svm.vmcb;
> -    eventinj_t eventinj;
> -    int inst_len, rc;
> +    int insn_len, rc;

I'm not really happy to see insn_len be plain int, but the task switch
case requires it to be so (at least for the time being).

Jan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.