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

[Xen-changelog] [xen master] x86/PMU: make {acquire, release}_pmu_ownership names consistent



commit 5e486852ee85e53a0993381f4cc2e220271a621c
Author:     Doug Goldstein <cardoe@xxxxxxxxxx>
AuthorDate: Wed Feb 17 16:24:29 2016 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Feb 17 16:24:29 2016 +0100

    x86/PMU: make {acquire,release}_pmu_ownership names consistent
    
    The function names were inconsistent with acquire and release being
    called acquire_pmu_ownership() and release_pmu_ownship() respectively.
    Function prototypes were available for both spellings so this change
    makes them consistent and drops the dual function prototypes.
    Additionally change the internal variable names within those functions
    to ownership as well.
    
    Signed-off-by: Doug Goldstein <cardoe@xxxxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
    Reviewed-by: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
---
 xen/arch/x86/cpu/vpmu_amd.c   |  4 ++--
 xen/arch/x86/cpu/vpmu_intel.c |  4 ++--
 xen/common/xenoprof.c         | 12 ++++++------
 xen/include/asm-x86/vpmu.h    |  3 ---
 xen/include/xen/xenoprof.h    |  4 ++--
 5 files changed, 12 insertions(+), 15 deletions(-)

diff --git a/xen/arch/x86/cpu/vpmu_amd.c b/xen/arch/x86/cpu/vpmu_amd.c
index 990e6f3..55d03b3 100644
--- a/xen/arch/x86/cpu/vpmu_amd.c
+++ b/xen/arch/x86/cpu/vpmu_amd.c
@@ -393,7 +393,7 @@ static int amd_vpmu_do_wrmsr(unsigned int msr, uint64_t 
msr_content,
         vpmu_reset(vpmu, VPMU_RUNNING);
         if ( has_hvm_container_vcpu(v) && is_msr_bitmap_on(vpmu) )
              amd_vpmu_unset_msr_bitmap(v);
-        release_pmu_ownship(PMU_OWNER_HVM);
+        release_pmu_ownership(PMU_OWNER_HVM);
     }
 
     if ( !vpmu_is_set(vpmu, VPMU_CONTEXT_LOADED)
@@ -442,7 +442,7 @@ static void amd_vpmu_destroy(struct vcpu *v)
     vpmu->priv_context = NULL;
 
     if ( vpmu_is_set(vpmu, VPMU_RUNNING) )
-        release_pmu_ownship(PMU_OWNER_HVM);
+        release_pmu_ownership(PMU_OWNER_HVM);
 
     vpmu_clear(vpmu);
 }
diff --git a/xen/arch/x86/cpu/vpmu_intel.c b/xen/arch/x86/cpu/vpmu_intel.c
index 50b5831..e8049ed 100644
--- a/xen/arch/x86/cpu/vpmu_intel.c
+++ b/xen/arch/x86/cpu/vpmu_intel.c
@@ -517,7 +517,7 @@ static int core2_vpmu_alloc_resource(struct vcpu *v)
     return 1;
 
 out_err:
-    release_pmu_ownship(PMU_OWNER_HVM);
+    release_pmu_ownership(PMU_OWNER_HVM);
 
     xfree(core2_vpmu_cxt);
     xfree(p);
@@ -892,7 +892,7 @@ static void core2_vpmu_destroy(struct vcpu *v)
     vpmu->priv_context = NULL;
     if ( has_hvm_container_vcpu(v) && cpu_has_vmx_msr_bitmap )
         core2_vpmu_unset_msr_bitmap(v->arch.hvm_vmx.msr_bitmap);
-    release_pmu_ownship(PMU_OWNER_HVM);
+    release_pmu_ownership(PMU_OWNER_HVM);
     vpmu_clear(vpmu);
 }
 
diff --git a/xen/common/xenoprof.c b/xen/common/xenoprof.c
index 19b4605..7a3fc86 100644
--- a/xen/common/xenoprof.c
+++ b/xen/common/xenoprof.c
@@ -50,16 +50,16 @@ static u64 passive_samples;
 static u64 idle_samples;
 static u64 others_samples;
 
-int acquire_pmu_ownership(int pmu_ownship)
+int acquire_pmu_ownership(int pmu_ownership)
 {
     spin_lock(&pmu_owner_lock);
     if ( pmu_owner == PMU_OWNER_NONE )
     {
-        pmu_owner = pmu_ownship;
+        pmu_owner = pmu_ownership;
         goto out;
     }
 
-    if ( pmu_owner == pmu_ownship )
+    if ( pmu_owner == pmu_ownership )
         goto out;
 
     spin_unlock(&pmu_owner_lock);
@@ -71,10 +71,10 @@ int acquire_pmu_ownership(int pmu_ownship)
     return 1;
 }
 
-void release_pmu_ownship(int pmu_ownship)
+void release_pmu_ownership(int pmu_ownership)
 {
     spin_lock(&pmu_owner_lock);
-    if ( pmu_ownship == PMU_OWNER_HVM )
+    if ( pmu_ownership == PMU_OWNER_HVM )
         pmu_hvm_refcount--;
     if ( !pmu_hvm_refcount )
         pmu_owner = PMU_OWNER_NONE;
@@ -847,7 +847,7 @@ ret_t do_xenoprof_op(int op, XEN_GUEST_HANDLE_PARAM(void) 
arg)
             break;
         x = current->domain->xenoprof;
         unshare_xenoprof_page_with_guest(x);
-        release_pmu_ownship(PMU_OWNER_XENOPROF);
+        release_pmu_ownership(PMU_OWNER_XENOPROF);
         break;
     }
 
diff --git a/xen/include/asm-x86/vpmu.h b/xen/include/asm-x86/vpmu.h
index 67e73dc..ed9ec07 100644
--- a/xen/include/asm-x86/vpmu.h
+++ b/xen/include/asm-x86/vpmu.h
@@ -121,9 +121,6 @@ static inline int vpmu_do_rdmsr(unsigned int msr, uint64_t 
*msr_content)
     return vpmu_do_msr(msr, msr_content, 0, 0);
 }
 
-extern int acquire_pmu_ownership(int pmu_ownership);
-extern void release_pmu_ownership(int pmu_ownership);
-
 extern unsigned int vpmu_mode;
 extern unsigned int vpmu_features;
 
diff --git a/xen/include/xen/xenoprof.h b/xen/include/xen/xenoprof.h
index 7804e69..9b9ef56 100644
--- a/xen/include/xen/xenoprof.h
+++ b/xen/include/xen/xenoprof.h
@@ -73,8 +73,8 @@ int xenoprof_add_trace(struct vcpu *, uint64_t pc, int mode);
 #define PMU_OWNER_NONE          0
 #define PMU_OWNER_XENOPROF      1
 #define PMU_OWNER_HVM           2
-int acquire_pmu_ownship(int pmu_ownership);
-void release_pmu_ownship(int pmu_ownership);
+int acquire_pmu_ownership(int pmu_ownership);
+void release_pmu_ownership(int pmu_ownership);
 
 void xenoprof_log_event(struct vcpu *, const struct cpu_user_regs *,
                         uint64_t pc, int mode, int event);
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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