From patchwork Sun Oct 8 07:23:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9991749 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 E2F8760244 for ; Sun, 8 Oct 2017 07:47:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5B7F28689 for ; Sun, 8 Oct 2017 07:47:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA94E28713; Sun, 8 Oct 2017 07:47:58 +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 8059D28689 for ; Sun, 8 Oct 2017 07:47:58 +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 1e16Gx-0002i2-90; Sun, 08 Oct 2017 07:45:15 +0000 Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e16Gv-0002fh-9y for xen-devel@lists.xenproject.org; Sun, 08 Oct 2017 07:45:13 +0000 Received: from [85.158.139.211] by server-10.bemta-5.messagelabs.com id A9/1F-01781-987D9D95; Sun, 08 Oct 2017 07:45:13 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrPIsWRWlGSWpSXmKPExsXS1taRottx/Wa kwdszShbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8asa7fZC2bzVcxdd42pgXEtdxcjJ4eQQIXE vcZjLCC2hACvxJFlM1gh7ACJvytfsncxcgHVNDBKvNk4lxEkwSagLvH4aw8TiC0ioCRxb9VkJ pAiZoHfjBI7H+xj62Lk4BAWcJE4/TkKpIZFQFXi94pPzCA2r4C7ROONP8wQC+QkTh6bDLaMU8 BDYtb5DewQB7lLrF7dzghRLyhxcuYTFpCRzEB7188TAgkzC8hLNG+dzTyBUWAWkqpZCFWzkFQ tYGRexahenFpUllqka6qXVJSZnlGSm5iZo2toYKqXm1pcnJiempOYVKyXnJ+7iREYmAxAsIPx S7/zIUZJDiYlUd4/V25GCvEl5adUZiQWZ8QXleakFh9ilOHgUJLg3XoNKCdYlJqeWpGWmQOME Zi0BAePkggvCzBOhHiLCxJzizPTIVKnGHU5Om7e/cMkxJKXn5cqJc4bCzJDAKQoozQPbgQsXi 8xykoJ8zICHSXEU5BalJtZgir/ilGcg1FJmHc3yBSezLwSuE2vgI5gAjqCsfgGyBEliQgpqQZ Gsz9bLwnmPFuZObPricz1uqr08gaeUudCn1ddt7neJy7/LMvV7Nmx3PzChG2L3lufdnw018u2 3XrqjgdHKuKftE+d5/rjYpJQ6K5vn9eorVsWev6HlJdaouCknnvnU8MFHRL/tSu1Or14e/R7R fbG9XoqWjUPQ/qCVs3RcdTLfdZ7TCPn+PTJSizFGYmGWsxFxYkA/ltGeNICAAA= X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-4.tower-206.messagelabs.com!1507448709!105947646!2 X-Originating-IP: [134.134.136.100] 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 23233 invoked from network); 8 Oct 2017 07:45:12 -0000 Received: from mga07.intel.com (HELO mga07.intel.com) (134.134.136.100) by server-4.tower-206.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 8 Oct 2017 07:45:12 -0000 Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga105.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="1022874879" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga003.jf.intel.com with ESMTP; 08 Oct 2017 00:44:39 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Sun, 8 Oct 2017 15:23:52 +0800 Message-Id: <1507447441-5422-8-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: Wei Liu , Yi Sun , Andrew Cooper , Jan Beulich , Chao Peng , =?UTF-8?q?Roger=20Pau=20Monn=C3=A9?= Subject: [Xen-devel] [PATCH v6 07/16] x86: implement get value interface for MBA 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 implements get value domctl interface for MBA. Signed-off-by: Yi Sun Reviewed-by: Roger Pau Monné Acked-by: Jan Beulich --- CC: Andrew Cooper CC: Jan Beulich CC: Wei Liu CC: Roger Pau Monné CC: Chao Peng v5: - use newly defined macro to get MBA thrtl. (suggested by Roger Pau Monné) v4: - remove 'ALLOC_' from macro names. (suggested by Roger Pau Monné) v3: - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'. (suggested by Roger Pau Monné) --- xen/arch/x86/domctl.c | 4 ++++ xen/include/public/domctl.h | 1 + 2 files changed, 5 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 0cd18a6..17fd3ad 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1491,6 +1491,10 @@ long arch_do_domctl( ret = domctl_psr_get_val(d, domctl, PSR_TYPE_L2_CBM, copyback); break; + case XEN_DOMCTL_PSR_GET_MBA_THRTL: + ret = domctl_psr_get_val(d, domctl, PSR_TYPE_MBA_THRTL, copyback); + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index c099334..e8f4c4c 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1069,6 +1069,7 @@ struct xen_domctl_psr_alloc { #define XEN_DOMCTL_PSR_GET_L3_DATA 5 #define XEN_DOMCTL_PSR_SET_L2_CBM 6 #define XEN_DOMCTL_PSR_GET_L2_CBM 7 +#define XEN_DOMCTL_PSR_GET_MBA_THRTL 9 uint32_t cmd; /* IN: XEN_DOMCTL_PSR_* */ uint32_t target; /* IN */ uint64_t data; /* IN/OUT */