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

No functional change.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
xen/arch/x86/hvm/svm/nestedsvm.c
xen/arch/x86/hvm/svm/svm.c
xen/arch/x86/hvm/svm/vmcb.c
xen/include/asm-x86/hvm/svm/vmcb.h
xen/include/asm-x86/hvm/vcpu.h

index a1f840eb66ff2d21fa42edd7e6e5c280584fc353..9d0fef13fc20cdd556bb489cf438e030b5f95386 100644 (file)
@@ -350,7 +350,7 @@ static int nsvm_vcpu_hostrestore(struct vcpu *v, struct cpu_user_regs *regs)
 
 static int nsvm_vmrun_permissionmap(struct vcpu *v, bool_t viopm)
 {
-    struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
+    struct svm_vcpu *arch_svm = &v->arch.hvm_svm;
     struct nestedsvm *svm = &vcpu_nestedsvm(v);
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
     struct vmcb_struct *ns_vmcb = nv->nv_vvmcx;
index 92b29b1a8730513bf416445f60dde05fe426b1c5..fc3daa6304efec8f1855ea36d321d0d5ac86ee8a 100644 (file)
@@ -663,8 +663,8 @@ static void svm_update_guest_efer(struct vcpu *v)
 
 static void svm_cpuid_policy_changed(struct vcpu *v)
 {
-    struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
-    struct vmcb_struct *vmcb = arch_svm->vmcb;
+    struct svm_vcpu *svm = &v->arch.hvm_svm;
+    struct vmcb_struct *vmcb = svm->vmcb;
     const struct cpuid_policy *cp = v->domain->arch.cpuid;
     u32 bitmap = vmcb_get_exception_intercepts(vmcb);
 
@@ -683,22 +683,22 @@ static void svm_cpuid_policy_changed(struct vcpu *v)
 
 static void svm_sync_vmcb(struct vcpu *v, enum vmcb_sync_state new_state)
 {
-    struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
+    struct svm_vcpu *svm = &v->arch.hvm_svm;
 
     if ( new_state == vmcb_needs_vmsave )
     {
-        if ( arch_svm->vmcb_sync_state == vmcb_needs_vmload )
-            svm_vmload(arch_svm->vmcb);
+        if ( svm->vmcb_sync_state == vmcb_needs_vmload )
+            svm_vmload(svm->vmcb);
 
-        arch_svm->vmcb_sync_state = new_state;
+        svm->vmcb_sync_state = new_state;
     }
     else
     {
-        if ( arch_svm->vmcb_sync_state == vmcb_needs_vmsave )
-            svm_vmsave(arch_svm->vmcb);
+        if ( svm->vmcb_sync_state == vmcb_needs_vmsave )
+            svm_vmsave(svm->vmcb);
 
-        if ( arch_svm->vmcb_sync_state != vmcb_needs_vmload )
-            arch_svm->vmcb_sync_state = new_state;
+        if ( svm->vmcb_sync_state != vmcb_needs_vmload )
+            svm->vmcb_sync_state = new_state;
     }
 }
 
index 3776c532245748812930995358f246cbacc35f12..2fa1ff532be37cfa9ba8ba8a284ae584f064bf21 100644 (file)
@@ -53,8 +53,8 @@ void free_vmcb(struct vmcb_struct *vmcb)
 /* This function can directly access fields which are covered by clean bits. */
 static int construct_vmcb(struct vcpu *v)
 {
-    struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
-    struct vmcb_struct *vmcb = arch_svm->vmcb;
+    struct svm_vcpu *svm = &v->arch.hvm_svm;
+    struct vmcb_struct *vmcb = svm->vmcb;
 
     /* Build-time check of the size of VMCB AMD structure. */
     BUILD_BUG_ON(sizeof(*vmcb) != PAGE_SIZE);
@@ -84,13 +84,13 @@ static int construct_vmcb(struct vcpu *v)
                              CR_INTERCEPT_CR8_READ |
                              CR_INTERCEPT_CR8_WRITE);
 
-    arch_svm->vmcb_sync_state = vmcb_needs_vmload;
+    svm->vmcb_sync_state = vmcb_needs_vmload;
 
     /* I/O and MSR permission bitmaps. */
-    arch_svm->msrpm = alloc_xenheap_pages(get_order_from_bytes(MSRPM_SIZE), 0);
-    if ( arch_svm->msrpm == NULL )
+    svm->msrpm = alloc_xenheap_pages(get_order_from_bytes(MSRPM_SIZE), 0);
+    if ( svm->msrpm == NULL )
         return -ENOMEM;
-    memset(arch_svm->msrpm, 0xff, MSRPM_SIZE);
+    memset(svm->msrpm, 0xff, MSRPM_SIZE);
 
     svm_disable_intercept_for_msr(v, MSR_FS_BASE);
     svm_disable_intercept_for_msr(v, MSR_GS_BASE);
@@ -105,7 +105,7 @@ static int construct_vmcb(struct vcpu *v)
     if ( cpu_has_lwp )
         svm_disable_intercept_for_msr(v, MSR_AMD64_LWP_CBADDR);
 
-    vmcb->_msrpm_base_pa = (u64)virt_to_maddr(arch_svm->msrpm);
+    vmcb->_msrpm_base_pa = virt_to_maddr(svm->msrpm);
     vmcb->_iopm_base_pa = __pa(v->domain->arch.hvm.io_bitmap);
 
     /* Virtualise EFLAGS.IF and LAPIC TPR (CR8). */
@@ -225,7 +225,7 @@ static int construct_vmcb(struct vcpu *v)
 int svm_create_vmcb(struct vcpu *v)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
-    struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
+    struct svm_vcpu *svm = &v->arch.hvm_svm;
     int rc;
 
     if ( (nv->nv_n1vmcx == NULL) &&
@@ -235,38 +235,38 @@ int svm_create_vmcb(struct vcpu *v)
         return -ENOMEM;
     }
 
-    arch_svm->vmcb = nv->nv_n1vmcx;
+    svm->vmcb = nv->nv_n1vmcx;
     rc = construct_vmcb(v);
     if ( rc != 0 )
     {
         free_vmcb(nv->nv_n1vmcx);
         nv->nv_n1vmcx = NULL;
-        arch_svm->vmcb = NULL;
+        svm->vmcb = NULL;
         return rc;
     }
 
-    arch_svm->vmcb_pa = nv->nv_n1vmcx_pa = virt_to_maddr(arch_svm->vmcb);
+    svm->vmcb_pa = nv->nv_n1vmcx_pa = virt_to_maddr(svm->vmcb);
     return 0;
 }
 
 void svm_destroy_vmcb(struct vcpu *v)
 {
     struct nestedvcpu *nv = &vcpu_nestedhvm(v);
-    struct arch_svm_struct *arch_svm = &v->arch.hvm_svm;
+    struct svm_vcpu *svm = &v->arch.hvm_svm;
 
     if ( nv->nv_n1vmcx != NULL )
         free_vmcb(nv->nv_n1vmcx);
 
-    if ( arch_svm->msrpm != NULL )
+    if ( svm->msrpm != NULL )
     {
         free_xenheap_pages(
-            arch_svm->msrpm, get_order_from_bytes(MSRPM_SIZE));
-        arch_svm->msrpm = NULL;
+            svm->msrpm, get_order_from_bytes(MSRPM_SIZE));
+        svm->msrpm = NULL;
     }
 
     nv->nv_n1vmcx = NULL;
     nv->nv_n1vmcx_pa = INVALID_PADDR;
-    arch_svm->vmcb = NULL;
+    svm->vmcb = NULL;
 }
 
 static void vmcb_dump(unsigned char ch)
index f7974dab09c0f510e0f6a53cb7bcd86a37642124..3a514f8de217e8668c179753c940326a1df7b7fd 100644 (file)
@@ -518,7 +518,7 @@ enum vmcb_sync_state {
     vmcb_needs_vmload     /* VMCB dirty (VMLOAD needed)? */
 };
 
-struct arch_svm_struct {
+struct svm_vcpu {
     struct vmcb_struct *vmcb;
     u64    vmcb_pa;
     unsigned long *msrpm;
index abf78e42526083f4d620fc9f46609de693d4daa6..c8d0a4e63fd08984ada7e4a138f519e936d84776 100644 (file)
@@ -177,7 +177,7 @@ struct hvm_vcpu {
 
     union {
         struct vmx_vcpu vmx;
-        struct arch_svm_struct svm;
+        struct svm_vcpu svm;
     } u;
 
     struct tasklet      assert_evtchn_irq_tasklet;