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

[Xen-changelog] [xen master] x86/svm: Rename arch_svm_struct to svm_vcpu



commit c285742f33d4cc3e106923ee70031cb556c5e39b
Author:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
AuthorDate: Tue Aug 28 15:59:28 2018 +0000
Commit:     Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
CommitDate: Fri Aug 31 15:40:39 2018 +0100

    x86/svm: Rename arch_svm_struct to svm_vcpu
    
    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@xxxxxxxxxx>
    Acked-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
 xen/arch/x86/hvm/svm/nestedsvm.c   |  2 +-
 xen/arch/x86/hvm/svm/svm.c         | 20 ++++++++++----------
 xen/arch/x86/hvm/svm/vmcb.c        | 32 ++++++++++++++++----------------
 xen/include/asm-x86/hvm/svm/vmcb.h |  2 +-
 xen/include/asm-x86/hvm/vcpu.h     |  2 +-
 5 files changed, 29 insertions(+), 29 deletions(-)

diff --git a/xen/arch/x86/hvm/svm/nestedsvm.c b/xen/arch/x86/hvm/svm/nestedsvm.c
index a1f840eb66..9d0fef13fc 100644
--- a/xen/arch/x86/hvm/svm/nestedsvm.c
+++ b/xen/arch/x86/hvm/svm/nestedsvm.c
@@ -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;
diff --git a/xen/arch/x86/hvm/svm/svm.c b/xen/arch/x86/hvm/svm/svm.c
index 92b29b1a87..fc3daa6304 100644
--- a/xen/arch/x86/hvm/svm/svm.c
+++ b/xen/arch/x86/hvm/svm/svm.c
@@ -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;
     }
 }
 
diff --git a/xen/arch/x86/hvm/svm/vmcb.c b/xen/arch/x86/hvm/svm/vmcb.c
index 3776c53224..2fa1ff532b 100644
--- a/xen/arch/x86/hvm/svm/vmcb.c
+++ b/xen/arch/x86/hvm/svm/vmcb.c
@@ -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)
diff --git a/xen/include/asm-x86/hvm/svm/vmcb.h 
b/xen/include/asm-x86/hvm/svm/vmcb.h
index f7974dab09..3a514f8de2 100644
--- a/xen/include/asm-x86/hvm/svm/vmcb.h
+++ b/xen/include/asm-x86/hvm/svm/vmcb.h
@@ -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;
diff --git a/xen/include/asm-x86/hvm/vcpu.h b/xen/include/asm-x86/hvm/vcpu.h
index abf78e4252..c8d0a4e63f 100644
--- a/xen/include/asm-x86/hvm/vcpu.h
+++ b/xen/include/asm-x86/hvm/vcpu.h
@@ -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;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/xen-changelog

 


Rackspace

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