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

[PATCH v2 1/5] vmx: Refactor vpid_sync_vcpu_gva()



Reorganize the logic to drop the use of goto.

Signed-off-by: Teddy Astie <teddy.astie@xxxxxxxxxx>
---
v2: Introduced

 xen/arch/x86/include/asm/hvm/vmx/vmx.h | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/xen/arch/x86/include/asm/hvm/vmx/vmx.h 
b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
index da04752e17..fe2cb4be0e 100644
--- a/xen/arch/x86/include/asm/hvm/vmx/vmx.h
+++ b/xen/arch/x86/include/asm/hvm/vmx/vmx.h
@@ -460,19 +460,16 @@ static inline void vpid_sync_vcpu_gva(struct vcpu *v, 
unsigned long gva)
      * If individual address invalidation is not supported, we escalate to
      * use single context invalidation.
      */
-    if ( likely(cpu_has_vmx_vpid_invvpid_individual_addr) )
-        goto execute_invvpid;
-
-    type = INVVPID_SINGLE_CONTEXT;
+    if ( unlikely(!cpu_has_vmx_vpid_invvpid_individual_addr) )
+        type = INVVPID_SINGLE_CONTEXT;
 
     /*
      * If single context invalidation is not supported, we escalate to
      * use all context invalidation.
      */
-    if ( !cpu_has_vmx_vpid_invvpid_single_context )
+    if ( unlikely(!cpu_has_vmx_vpid_invvpid_single_context) )
         type = INVVPID_ALL_CONTEXT;
 
-execute_invvpid:
     __invvpid(type, v->arch.hvm.n1asid.asid, (u64)gva);
 }
 
-- 
2.54.0



--
Teddy Astie | Vates XCP-ng Developer

XCP-ng & Xen Orchestra - Vates solutions

web: https://vates.tech

 


Rackspace

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