From patchwork Fri Oct 20 08:28:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 10019239 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 7E2F3602CB for ; Fri, 20 Oct 2017 08:52:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6E2ED28EA6 for ; Fri, 20 Oct 2017 08:52:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6349428EC0; Fri, 20 Oct 2017 08:52:11 +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 119E128EA6 for ; Fri, 20 Oct 2017 08:52:11 +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 1e5T0G-0006SV-Bo; Fri, 20 Oct 2017 08:50:04 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e5T0E-0006Gk-PV for xen-devel@lists.xenproject.org; Fri, 20 Oct 2017 08:50:02 +0000 Received: from [85.158.143.35] by server-2.bemta-6.messagelabs.com id 24/F7-31897-AB8B9E95; Fri, 20 Oct 2017 08:50:02 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFjrAIsWRWlGSWpSXmKPExsXS1tYhr7tzx8t Igz/7FS2+b5nM5MDocfjDFZYAxijWzLyk/IoE1owP81IKWvgqLqx9zNLAuJ67i5GTQ0igQuLM 1AmMILaEAK/EkWUzWCFsf4kFD9ewdzFyAdU0MEos+XgcLMEmoC7x+GsPE4gtIqAkcW/VZCaQI maB34wSOx/sYwNJCAu4SNw/tZcZxGYRUJX4tHkHC4jNK+Au0f99AjPEBjmJk8cmgw3lFPCQ2N t6mxHiIneJqWdmskPUC0qcnPkEqJcDaIG6xPp5QiBhZgF5ieats5knMArMQlI1C6FqFpKqBYz Mqxg1ilOLylKLdA2N9JKKMtMzSnITM3N0DQ3M9HJTi4sT01NzEpOK9ZLzczcxAkOTAQh2MF7e GHCIUZKDSUmUN7DyZaQQX1J+SmVGYnFGfFFpTmrxIUYZDg4lCV627UA5waLU9NSKtMwcYJTAp CU4eJREeB+BpHmLCxJzizPTIVKnGHU5Om7e/cMkxJKXn5cqJc7bB1IkAFKUUZoHNwIWsZcYZa WEeRmBjhLiKUgtys0sQZV/xSjOwagkzGsBMoUnM68EbtMroCOYgI5gt38BckRJIkJKqoFxL1u Ct9HuZy9mHvlrmf/1f7G1am/8zvrKqUd2u4dtucOZqtx0894CvYT+GxUX2Bcf3tKmy6NqsJo9 wCzPYXFeapXT5tTN5mU6at6nZNitLz1muNO3PeHfakPZVl22Cp7qKy/jdPXkGXcFBOx0elR2d knWyaQ3iqvyuNrZi25a+187ulnVPkOJpTgj0VCLuag4EQBpCYfh0wIAAA== X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-11.tower-21.messagelabs.com!1508489386!74969590!8 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 19082 invoked from network); 20 Oct 2017 08:50:01 -0000 Received: from mga06.intel.com (HELO mga06.intel.com) (134.134.136.31) by server-11.tower-21.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 20 Oct 2017 08:50:01 -0000 Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga104.jf.intel.com with ESMTP; 20 Oct 2017 01:50:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.43,405,1503385200"; d="scan'208";a="162752663" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.75]) by orsmga005.jf.intel.com with ESMTP; 20 Oct 2017 01:49:58 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Fri, 20 Oct 2017 16:28:19 +0800 Message-Id: <1508488108-7071-8-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1508488108-7071-1-git-send-email-yi.y.sun@linux.intel.com> References: <1508488108-7071-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 v9 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 ddd3b6d..f7d299d 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; + #undef domctl_psr_get_val default: diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index eaff9b3..44cf0b5 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1074,6 +1074,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 */