From patchwork Wed Feb 17 14:37:32 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Douglas Goldstein X-Patchwork-Id: 8339651 Return-Path: X-Original-To: patchwork-xen-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C7D2F9FC82 for ; Wed, 17 Feb 2016 14:40:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D29BB203B7 for ; Wed, 17 Feb 2016 14:40:36 +0000 (UTC) Received: from lists.xen.org (lists.xenproject.org [50.57.142.19]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C2CDD203AB for ; Wed, 17 Feb 2016 14:40:35 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xen.org) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW3Es-0004xD-43; Wed, 17 Feb 2016 14:37:58 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1aW3Eq-0004wx-5O for xen-devel@lists.xen.org; Wed, 17 Feb 2016 14:37:56 +0000 Received: from [85.158.137.68] by server-5.bemta-3.messagelabs.com id 7B/12-07651-2C584C65; Wed, 17 Feb 2016 14:37:54 +0000 X-Env-Sender: cardoe@cardoe.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1455719873!22798668!1 X-Originating-IP: [209.85.161.179] X-SpamReason: No, hits=0.5 required=7.0 tests=BODY_RANDOM_LONG X-StarScan-Received: X-StarScan-Version: 7.35.1; banners=-,-,- X-VirusChecked: Checked Received: (qmail 36689 invoked from network); 17 Feb 2016 14:37:54 -0000 Received: from mail-yw0-f179.google.com (HELO mail-yw0-f179.google.com) (209.85.161.179) by server-15.tower-31.messagelabs.com with AES128-GCM-SHA256 encrypted SMTP; 17 Feb 2016 14:37:54 -0000 Received: by mail-yw0-f179.google.com with SMTP id h129so14285328ywb.1 for ; Wed, 17 Feb 2016 06:37:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cardoe.com; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=lj1NLvrHIhpxPUySoWspojM3n+m++Om1Y1u1dAMs3cE=; b=dBVIXEG66lQqvcrVvCaOH6fBWZWS7mioa8HGxyEp01eMidmg+b//JN80dplBXSlCT+ Qr/ggvwcKrDf5+GV8oo90BB2xU7ewL08rG9GCESb5vdv7f1yKOgqbgkm5RqpqAIxqgw/ yaFSxYLBHzPsrKhAfZwAUT5R3nJzD4aYRHCoo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=lj1NLvrHIhpxPUySoWspojM3n+m++Om1Y1u1dAMs3cE=; b=my9LOXGwp9KXP75YVZhz0OrSTumXehY4ByZaaKG3f2d51TbPJTFs2FC5vnR6f3vtVJ S8MxnJvHGNVZ0yXyurb2WL3i9yuEcJJraiQr933wrF0wg3OQihgpwqTqPU5v/sDSOFIF ZAvXaML25hC8nPpxnwn5rH1QrSLlkR1p7HVzXcUpgW7opXjYQBKU8e2nH1likJOhjt25 KDU3YKr3c5EDYaWPAijvHXoxymrLNowJzQ6M3DL9MW0j8ilmdS/uCpU/0h9jjFaAj/dv 4USp9QB+yFyeQAg4ZR41k3ACdjbx5kZc9mC81pDaUA3ig0wc6jld8rV4VN58tvh8jRCz BEmg== X-Gm-Message-State: AG10YOQZ2IN4YLNbkuHFy/s2E39LHzGR4//bZma5jfpfQtXFOeJcjOX6coi35JPCdHOruw== X-Received: by 10.13.230.78 with SMTP id p75mr1051014ywe.234.1455719873538; Wed, 17 Feb 2016 06:37:53 -0800 (PST) Received: from swanson.lan (c-68-46-196-185.hsd1.al.comcast.net. [68.46.196.185]) by smtp.gmail.com with ESMTPSA id r84sm926178ywe.54.2016.02.17.06.37.52 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 17 Feb 2016 06:37:52 -0800 (PST) From: Doug Goldstein To: xen-devel@lists.xen.org Date: Wed, 17 Feb 2016 08:37:32 -0600 Message-Id: <1455719856-20465-2-git-send-email-cardoe@cardoe.com> X-Mailer: git-send-email 2.4.10 In-Reply-To: <1455719856-20465-1-git-send-email-cardoe@cardoe.com> References: <1455719856-20465-1-git-send-email-cardoe@cardoe.com> Cc: Doug Goldstein Subject: [Xen-devel] [PATCH v3 1/3] PMU: make {acquire, release}_pmu_ownership names consistent X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- change since v2: - new in this series based on review --- 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);