]> xenbits.xensource.com Git - xen.git/commitdiff
x86/vmx: Rename arch_vmx_struct to vmx_vcpu
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 28 Aug 2018 15:53:06 +0000 (15:53 +0000)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Fri, 31 Aug 2018 14:40:38 +0000 (15:40 +0100)
The suffix and prefix are redundant, and the name is curiously odd.  Rename it
to vmx_vcpu to be consistent with all the other similar structures.  In
addition, rename local arch_vmx local variables to vmx for further
consistency.

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Kevin Tian <kevin.tian@intel.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
---
CC: Roger Pau Monné <roger.pau@citrix.com>
Some of the local pointers are named arch_vmx.  I'm open to renaming them to
just vmx (like all the other local pointers) if people are happy with the
additional patch delta.

xen/arch/x86/hvm/vmx/vmcs.c
xen/arch/x86/hvm/vmx/vmx.c
xen/include/asm-x86/hvm/vcpu.h
xen/include/asm-x86/hvm/vmx/vmcs.h

index b39e571c8f4dc556edc55bea7655beb29511f49a..a847f371866b7a5cc5b0508a59f166bc3c8b8622 100644 (file)
@@ -518,23 +518,23 @@ static void vmx_free_vmcs(paddr_t pa)
 static void __vmx_clear_vmcs(void *info)
 {
     struct vcpu *v = info;
-    struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
+    struct vmx_vcpu *vmx = &v->arch.hvm_vmx;
 
     /* Otherwise we can nest (vmx_cpu_down() vs. vmx_clear_vmcs()). */
     ASSERT(!local_irq_is_enabled());
 
-    if ( arch_vmx->active_cpu == smp_processor_id() )
+    if ( vmx->active_cpu == smp_processor_id() )
     {
-        __vmpclear(arch_vmx->vmcs_pa);
-        if ( arch_vmx->vmcs_shadow_maddr )
-            __vmpclear(arch_vmx->vmcs_shadow_maddr);
+        __vmpclear(vmx->vmcs_pa);
+        if ( vmx->vmcs_shadow_maddr )
+            __vmpclear(vmx->vmcs_shadow_maddr);
 
-        arch_vmx->active_cpu = -1;
-        arch_vmx->launched   = 0;
+        vmx->active_cpu = -1;
+        vmx->launched   = 0;
 
-        list_del(&arch_vmx->active_list);
+        list_del(&vmx->active_list);
 
-        if ( arch_vmx->vmcs_pa == this_cpu(current_vmcs) )
+        if ( vmx->vmcs_pa == this_cpu(current_vmcs) )
             this_cpu(current_vmcs) = 0;
     }
 }
@@ -901,7 +901,7 @@ bool vmx_msr_is_intercepted(struct vmx_msr_bitmap *msr_bitmap,
  */
 void vmx_vmcs_switch(paddr_t from, paddr_t to)
 {
-    struct arch_vmx_struct *vmx = &current->arch.hvm_vmx;
+    struct vmx_vcpu *vmx = &current->arch.hvm_vmx;
     spin_lock(&vmx->vmcs_lock);
 
     __vmpclear(from);
@@ -1308,7 +1308,7 @@ static struct vmx_msr_entry *locate_msr_entry(
 struct vmx_msr_entry *vmx_find_msr(const struct vcpu *v, uint32_t msr,
                                    enum vmx_msr_list_type type)
 {
-    const struct arch_vmx_struct *vmx = &v->arch.hvm_vmx;
+    const struct vmx_vcpu *vmx = &v->arch.hvm_vmx;
     struct vmx_msr_entry *start = NULL, *ent, *end;
     unsigned int substart = 0, subend = vmx->msr_save_count;
     unsigned int total = vmx->msr_load_count;
@@ -1349,7 +1349,7 @@ struct vmx_msr_entry *vmx_find_msr(const struct vcpu *v, uint32_t msr,
 int vmx_add_msr(struct vcpu *v, uint32_t msr, uint64_t val,
                 enum vmx_msr_list_type type)
 {
-    struct arch_vmx_struct *vmx = &v->arch.hvm_vmx;
+    struct vmx_vcpu *vmx = &v->arch.hvm_vmx;
     struct vmx_msr_entry **ptr, *start = NULL, *ent, *end;
     unsigned int substart, subend, total;
     int rc;
@@ -1460,7 +1460,7 @@ int vmx_add_msr(struct vcpu *v, uint32_t msr, uint64_t val,
 
 int vmx_del_msr(struct vcpu *v, uint32_t msr, enum vmx_msr_list_type type)
 {
-    struct arch_vmx_struct *vmx = &v->arch.hvm_vmx;
+    struct vmx_vcpu *vmx = &v->arch.hvm_vmx;
     struct vmx_msr_entry *start = NULL, *ent, *end;
     unsigned int substart = 0, subend = vmx->msr_save_count;
     unsigned int total = vmx->msr_load_count;
@@ -1743,20 +1743,20 @@ void vmx_domain_update_eptp(struct domain *d)
 
 int vmx_create_vmcs(struct vcpu *v)
 {
-    struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
+    struct vmx_vcpu *vmx = &v->arch.hvm_vmx;
     int rc;
 
-    if ( (arch_vmx->vmcs_pa = vmx_alloc_vmcs()) == 0 )
+    if ( (vmx->vmcs_pa = vmx_alloc_vmcs()) == 0 )
         return -ENOMEM;
 
-    INIT_LIST_HEAD(&arch_vmx->active_list);
-    __vmpclear(arch_vmx->vmcs_pa);
-    arch_vmx->active_cpu = -1;
-    arch_vmx->launched   = 0;
+    INIT_LIST_HEAD(&vmx->active_list);
+    __vmpclear(vmx->vmcs_pa);
+    vmx->active_cpu = -1;
+    vmx->launched   = 0;
 
     if ( (rc = construct_vmcs(v)) != 0 )
     {
-        vmx_free_vmcs(arch_vmx->vmcs_pa);
+        vmx_free_vmcs(vmx->vmcs_pa);
         return rc;
     }
 
@@ -1765,11 +1765,11 @@ int vmx_create_vmcs(struct vcpu *v)
 
 void vmx_destroy_vmcs(struct vcpu *v)
 {
-    struct arch_vmx_struct *arch_vmx = &v->arch.hvm_vmx;
+    struct vmx_vcpu *vmx = &v->arch.hvm_vmx;
 
     vmx_clear_vmcs(v);
 
-    vmx_free_vmcs(arch_vmx->vmcs_pa);
+    vmx_free_vmcs(vmx->vmcs_pa);
 
     free_xenheap_page(v->arch.hvm_vmx.host_msr_area);
     free_xenheap_page(v->arch.hvm_vmx.msr_area);
index d605554c50ab597d71d41d8efce5fb6d4f2d4132..141737c72eb6fc4ddbf8855c60e94fdc714faf89 100644 (file)
@@ -205,7 +205,7 @@ void vmx_pi_desc_fixup(unsigned int cpu)
 {
     unsigned int new_cpu, dest;
     unsigned long flags;
-    struct arch_vmx_struct *vmx, *tmp;
+    struct vmx_vcpu *vmx, *tmp;
     spinlock_t *new_lock, *old_lock = &per_cpu(vmx_pi_blocking, cpu).lock;
     struct list_head *blocked_vcpus = &per_cpu(vmx_pi_blocking, cpu).list;
 
@@ -2357,7 +2357,7 @@ static struct hvm_function_table __initdata vmx_function_table = {
 /* Handle VT-d posted-interrupt when VCPU is blocked. */
 static void pi_wakeup_interrupt(struct cpu_user_regs *regs)
 {
-    struct arch_vmx_struct *vmx, *tmp;
+    struct vmx_vcpu *vmx, *tmp;
     spinlock_t *lock = &per_cpu(vmx_pi_blocking, smp_processor_id()).lock;
     struct list_head *blocked_vcpus =
                &per_cpu(vmx_pi_blocking, smp_processor_id()).list;
index 54ea0445a71bb88c0efde09ed7b03ef98bd9f6c4..abf78e42526083f4d620fc9f46609de693d4daa6 100644 (file)
@@ -176,7 +176,7 @@ struct hvm_vcpu {
     u64                 msr_xss;
 
     union {
-        struct arch_vmx_struct vmx;
+        struct vmx_vcpu vmx;
         struct arch_svm_struct svm;
     } u;
 
index 46668a7007964cabdbe53d0b277e1d55b885b731..f964a951eaa8c8d00023412cfa8ec2e115f7d4e4 100644 (file)
@@ -100,7 +100,7 @@ struct pi_blocking_vcpu {
     spinlock_t           *lock;
 };
 
-struct arch_vmx_struct {
+struct vmx_vcpu {
     /* Physical address of VMCS. */
     paddr_t              vmcs_pa;
     /* VMCS shadow machine address. */