Re: [Xen-devel] [PATCH 4/9] x86/vvmx: Remove unnecessary VMX operand reads

2017-11-02 Thread Tian, Kevin
> From: Euan Harris [mailto:euan.har...@citrix.com]
> Sent: Friday, October 27, 2017 1:03 AM
> 
>  * vpid is never used in nvmx_handle_invept() so there is no point in
>reading it.

I think you meant nvmx_handle_invvpid

> 
>  * vmptrst's operand is the memory address to which to write the VMCS
>pointer.   gpa is the pointer to write.   Reading the address into
>gpa is meaningless.
> 
> Signed-off-by: Euan Harris 
> ---
>  xen/arch/x86/hvm/vmx/vvmx.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/xen/arch/x86/hvm/vmx/vvmx.c
> b/xen/arch/x86/hvm/vmx/vvmx.c
> index df84592490..32c07eca3d 100644
> --- a/xen/arch/x86/hvm/vmx/vvmx.c
> +++ b/xen/arch/x86/hvm/vmx/vvmx.c
> @@ -1801,7 +1801,7 @@ int nvmx_handle_vmptrst(struct cpu_user_regs
> *regs)
>  unsigned long gpa = 0;
>  int rc;
> 
> -rc = decode_vmx_inst(regs, , , 0);
> +rc = decode_vmx_inst(regs, , NULL, 0);
>  if ( rc != X86EMUL_OKAY )
>  return rc;
> 
> @@ -1992,10 +1992,9 @@ int nvmx_handle_invept(struct cpu_user_regs
> *regs)
>  int nvmx_handle_invvpid(struct cpu_user_regs *regs)
>  {
>  struct vmx_inst_decoded decode;
> -unsigned long vpid;
>  int ret;
> 
> -if ( (ret = decode_vmx_inst(regs, , , 0)) != X86EMUL_OKAY )
> +if ( (ret = decode_vmx_inst(regs, , NULL, 0)) != X86EMUL_OKAY )
>  return ret;
> 
>  switch ( reg_read(regs, decode.op[1].reg_idx) )
> --
> 2.13.6


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel


[Xen-devel] [PATCH 4/9] x86/vvmx: Remove unnecessary VMX operand reads

2017-10-26 Thread Euan Harris
 * vpid is never used in nvmx_handle_invept() so there is no point in
   reading it.

 * vmptrst's operand is the memory address to which to write the VMCS
   pointer.   gpa is the pointer to write.   Reading the address into
   gpa is meaningless.

Signed-off-by: Euan Harris 
---
 xen/arch/x86/hvm/vmx/vvmx.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/xen/arch/x86/hvm/vmx/vvmx.c b/xen/arch/x86/hvm/vmx/vvmx.c
index df84592490..32c07eca3d 100644
--- a/xen/arch/x86/hvm/vmx/vvmx.c
+++ b/xen/arch/x86/hvm/vmx/vvmx.c
@@ -1801,7 +1801,7 @@ int nvmx_handle_vmptrst(struct cpu_user_regs *regs)
 unsigned long gpa = 0;
 int rc;
 
-rc = decode_vmx_inst(regs, , , 0);
+rc = decode_vmx_inst(regs, , NULL, 0);
 if ( rc != X86EMUL_OKAY )
 return rc;
 
@@ -1992,10 +1992,9 @@ int nvmx_handle_invept(struct cpu_user_regs *regs)
 int nvmx_handle_invvpid(struct cpu_user_regs *regs)
 {
 struct vmx_inst_decoded decode;
-unsigned long vpid;
 int ret;
 
-if ( (ret = decode_vmx_inst(regs, , , 0)) != X86EMUL_OKAY )
+if ( (ret = decode_vmx_inst(regs, , NULL, 0)) != X86EMUL_OKAY )
 return ret;
 
 switch ( reg_read(regs, decode.op[1].reg_idx) )
-- 
2.13.6


___
Xen-devel mailing list
Xen-devel@lists.xen.org
https://lists.xen.org/xen-devel