From patchwork Sun Oct 8 07:23:58 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9991743 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5BF9960244 for ; Sun, 8 Oct 2017 07:47:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DC8928689 for ; Sun, 8 Oct 2017 07:47:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 425E528713; Sun, 8 Oct 2017 07:47:54 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D53FC28689 for ; Sun, 8 Oct 2017 07:47:53 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e16Gz-0002kU-3N; Sun, 08 Oct 2017 07:45:17 +0000 Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e16Gx-0002i6-Qa for xen-devel@lists.xenproject.org; Sun, 08 Oct 2017 07:45:15 +0000 Received: from [85.158.137.68] by server-11.bemta-3.messagelabs.com id 2A/B6-01777-A87D9D95; Sun, 08 Oct 2017 07:45:14 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRWlGSWpSXmKPExsXS1tYhr9t5/Wa kwbeVwhbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8bLnc/YCparVnRe72VvYFwv08XIwSEkUCEx 90xxFyMnh4QAr8SRZTNYIewAiUfXZjJ1MXIBlTQwSryf9pEdJMEmoC7x+GsPE4gtIqAkcW/VZ LAiZoHrjBIPFk1hAhkqLOAl0f3TG6SGRUBV4vf1qcwgNq+Ah0TTulfsEAvkJE4emwy2jBMoPu v8BrC4kIC7xOrV7YwQ9YISJ2c+YQEZyQy0d/08IZAws4C8RPPW2cwTGAVmIamahVA1C0nVAkb mVYwaxalFZalFuoYWeklFmekZJbmJmTm6hgbGermpxcWJ6ak5iUnFesn5uZsYgYFZz8DAuIPx 92nPQ4ySHExKorx/rtyMFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBu/UaUE6wKDU9tSItMwcYI zBpCQ4eJRHeyZeA0rzFBYm5xZnpEKlTjLocHTfv/mESYsnLz0uVEueNBZkhAFKUUZoHNwIWr5 cYZaWEeRkZGBiEeApSi3IzS1DlXzGKczAqCfPuBpnCk5lXArfpFdARTEBHMBbfADmiJBEhJdX AOPX8dfb3UxoMZbXui7RFXFCyYfDTuGad4xe5S27tnw4p77zfzuahm0Plwy6XPllsZ20j++vd Y03GywfzD3ey6EbI2Oas+ZReIXqoj+8WU9zKMxztb6JbhXLZ9QQnZ+fx/ufc3lN4+NWb6okWL fWy6sFLQkp4Dk6qUrrIOnHJv7DFTt4R9eJKLMUZiYZazEXFiQAo4cdy0gIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-15.tower-31.messagelabs.com!1507448711!105203041!1 X-Originating-IP: [134.134.136.31] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.4.45; banners=-,-,- X-VirusChecked: Checked Received: (qmail 8421 invoked from network); 8 Oct 2017 07:45:13 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-15.tower-31.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Oct 2017 07:45:13 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 08 Oct 2017 00:45:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.42,493,1500966000"; d="scan'208"; a="1022874918" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga003.jf.intel.com with ESMTP; 08 Oct 2017 00:44:56 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Sun, 8 Oct 2017 15:23:58 +0800 Message-Id: <1507447441-5422-14-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1507447441-5422-1-git-send-email-yi.y.sun@linux.intel.com> References: <1507447441-5422-1-git-send-email-yi.y.sun@linux.intel.com> MIME-Version: 1.0 Cc: Ian Jackson , Chao Peng , Yi Sun , Wei Liu , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH v6 13/16] tools: rename 'xc_psr_cat_type' to 'xc_psr_type' X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP This patch renames 'xc_psr_cat_type' to 'xc_psr_type' so that the structure name is common for all allocation features. Signed-off-by: Yi Sun Acked-by: Wei Liu Reviewed-by: Chao Peng Reviewed-by: Roger Pau Monné --- CC: Ian Jackson CC: Wei Liu CC: Roger Pau Monné CC: Chao Peng v5: - remove a duplicated ';'. (suggested by Roger Pau Monné) v4: - move assignment of xc_type to its declaration place. (suggested by Roger Pau Monné) v3: - change 'xc_psr_val_type' to 'xc_psr_type'. (suggested by Roger Pau Monné) --- tools/libxc/include/xenctrl.h | 8 ++++---- tools/libxc/xc_psr.c | 4 ++-- tools/libxl/libxl_psr.c | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/tools/libxc/include/xenctrl.h b/tools/libxc/include/xenctrl.h index 2d977c8..2736bc5 100644 --- a/tools/libxc/include/xenctrl.h +++ b/tools/libxc/include/xenctrl.h @@ -2466,13 +2466,13 @@ enum xc_psr_cmt_type { }; typedef enum xc_psr_cmt_type xc_psr_cmt_type; -enum xc_psr_cat_type { +enum xc_psr_type { XC_PSR_CAT_L3_CBM = 1, XC_PSR_CAT_L3_CBM_CODE = 2, XC_PSR_CAT_L3_CBM_DATA = 3, XC_PSR_CAT_L2_CBM = 4, }; -typedef enum xc_psr_cat_type xc_psr_cat_type; +typedef enum xc_psr_type xc_psr_type; enum xc_psr_feat_type { XC_PSR_CAT_L3, @@ -2512,10 +2512,10 @@ int xc_psr_cmt_get_data(xc_interface *xch, uint32_t rmid, uint32_t cpu, int xc_psr_cmt_enabled(xc_interface *xch); int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid, - xc_psr_cat_type type, uint32_t target, + xc_psr_type type, uint32_t target, uint64_t data); int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid, - xc_psr_cat_type type, uint32_t target, + xc_psr_type type, uint32_t target, uint64_t *data); int xc_psr_get_hw_info(xc_interface *xch, uint32_t socket, xc_psr_feat_type type, xc_psr_hw_info *hw_info); diff --git a/tools/libxc/xc_psr.c b/tools/libxc/xc_psr.c index 2c605a7..01f4ba7 100644 --- a/tools/libxc/xc_psr.c +++ b/tools/libxc/xc_psr.c @@ -249,7 +249,7 @@ int xc_psr_cmt_enabled(xc_interface *xch) return 0; } int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid, - xc_psr_cat_type type, uint32_t target, + xc_psr_type type, uint32_t target, uint64_t data) { DECLARE_DOMCTL; @@ -284,7 +284,7 @@ int xc_psr_cat_set_domain_data(xc_interface *xch, uint32_t domid, } int xc_psr_cat_get_domain_data(xc_interface *xch, uint32_t domid, - xc_psr_cat_type type, uint32_t target, + xc_psr_type type, uint32_t target, uint64_t *data) { int rc; diff --git a/tools/libxl/libxl_psr.c b/tools/libxl/libxl_psr.c index b053abd..c54cb6f 100644 --- a/tools/libxl/libxl_psr.c +++ b/tools/libxl/libxl_psr.c @@ -303,11 +303,11 @@ out: return rc; } -static inline xc_psr_cat_type libxl__psr_cbm_type_to_libxc_psr_cat_type( +static inline xc_psr_type libxl__psr_cbm_type_to_libxc_psr_type( libxl_psr_cbm_type type) { - BUILD_BUG_ON(sizeof(libxl_psr_cbm_type) != sizeof(xc_psr_cat_type)); - return (xc_psr_cat_type)type; + BUILD_BUG_ON(sizeof(libxl_psr_cbm_type) != sizeof(xc_psr_type)); + return (xc_psr_type)type; } int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t domid, @@ -325,12 +325,11 @@ int libxl_psr_cat_set_cbm(libxl_ctx *ctx, uint32_t domid, } libxl_for_each_set_bit(socketid, *target_map) { - xc_psr_cat_type xc_type; + xc_psr_type xc_type = libxl__psr_cbm_type_to_libxc_psr_type(type); if (socketid >= nr_sockets) break; - xc_type = libxl__psr_cbm_type_to_libxc_psr_cat_type(type); if (xc_psr_cat_set_domain_data(ctx->xch, domid, xc_type, socketid, cbm)) { libxl__psr_cat_log_err_msg(gc, errno); @@ -349,7 +348,7 @@ int libxl_psr_cat_get_cbm(libxl_ctx *ctx, uint32_t domid, { GC_INIT(ctx); int rc = 0; - xc_psr_cat_type xc_type = libxl__psr_cbm_type_to_libxc_psr_cat_type(type); + xc_psr_type xc_type = libxl__psr_cbm_type_to_libxc_psr_type(type); if (xc_psr_cat_get_domain_data(ctx->xch, domid, xc_type, target, cbm_r)) {