From patchwork Tue Sep 5 09:32:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Yi Sun X-Patchwork-Id: 9938329 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 C1E56601EB for ; Tue, 5 Sep 2017 09:53:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B4FC628902 for ; Tue, 5 Sep 2017 09:53:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A9A6C2890C; Tue, 5 Sep 2017 09:53:32 +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 4F4A228902 for ; Tue, 5 Sep 2017 09:53:32 +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 1dpAVy-000778-Ss; Tue, 05 Sep 2017 09:51:26 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dpAVy-00076V-9c for xen-devel@lists.xenproject.org; Tue, 05 Sep 2017 09:51:26 +0000 Received: from [193.109.254.147] by server-3.bemta-6.messagelabs.com id F1/06-03093-D937EA95; Tue, 05 Sep 2017 09:51:25 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCIsWRWlGSWpSXmKPExsXS1taRoju7eF2 kwasZnBbft0xmcmD0OPzhCksAYxRrZl5SfkUCa8aDSRNYCl5wV2xafYW9gbGLs4uRk0NIoFLi 0offjCC2hACvxJFlM1ghbH+Jo89eMHUxcgHVNDBKLOu4xgySYBNQl3j8tYcJxBYRUJK4t2oyW BGzwDkmiT0fd4AlhAVcJFY/2wQ2lUVAVeL5gZ9gzbwC7hL7981ggtggJ3Hy2GSgbRwcnAIeEk uv1UEc5C7xZ9tdVohyQYmTM5+wgJQwA+1dP08IJMwsIC/RvHU28wRGgVlIqmYhVM1CUrWAkXk Vo0ZxalFZapGuoaFeUlFmekZJbmJmjq6hgZlebmpxcWJ6ak5iUrFecn7uJkZgaDIAwQ7GT8sC DjFKcjApifKGJq6LFOJLyk+pzEgszogvKs1JLT7EKMPBoSTBe6sIKCdYlJqeWpGWmQOMEpi0B AePkgjvOZA0b3FBYm5xZjpE6hSjopQ473GQhABIIqM0D64NFpmXGGWlhHkZgQ4R4ilILcrNLE GVf8UozsGoJMy7BGQKT2ZeCdz0V0CLmYAWV71cA7K4JBEhJdXAaCz080ux2o3Gj9nbVK8wv/Z 5/rS9ev42jmr1idOWhDbf3hljsCLrVS+Tp26vX8m5p/YbVngdMQiz3TtJoeLEBZ303rDMIoO3 LA8n6jdsiDp7Nvxk/cfth4pYpKdrHEgp4zb/bBZ8/cvNNcccJgioiG599nl3xUK+iU/e/GGv1 Tsr5NjK/IXZSImlOCPRUIu5qDgRAEqjKqbHAgAA X-Env-Sender: yi.y.sun@linux.intel.com X-Msg-Ref: server-15.tower-27.messagelabs.com!1504605073!62289035!3 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 42074 invoked from network); 5 Sep 2017 09:51:22 -0000 Received: from mga07.intel.com (HELO mga07.intel.com) (134.134.136.100) by server-15.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 5 Sep 2017 09:51:22 -0000 Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Sep 2017 02:51:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.41,479,1498546800"; d="scan'208";a="897185221" Received: from vmmmba-s2600wft.bj.intel.com ([10.240.193.80]) by FMSMGA003.fm.intel.com with ESMTP; 05 Sep 2017 02:51:17 -0700 From: Yi Sun To: xen-devel@lists.xenproject.org Date: Tue, 5 Sep 2017 17:32:28 +0800 Message-Id: <1504603957-5389-7-git-send-email-yi.y.sun@linux.intel.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1504603957-5389-1-git-send-email-yi.y.sun@linux.intel.com> References: <1504603957-5389-1-git-send-email-yi.y.sun@linux.intel.com> MIME-Version: 1.0 Cc: kevin.tian@intel.com, wei.liu2@citrix.com, andrew.cooper3@citrix.com, dario.faggioli@citrix.com, ian.jackson@eu.citrix.com, Yi Sun , julien.grall@arm.com, mengxu@cis.upenn.edu, jbeulich@suse.com, chao.p.peng@linux.intel.com, dgdegra@tycho.nsa.gov, roger.pau@citrix.com Subject: [Xen-devel] [PATCH v3 06/15] 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é --- v3: - change 'PSR_VAL_TYPE_MBA' to 'PSR_TYPE_MBA_THRTL'. (suggested by Roger Pau Monné) --- xen/arch/x86/domctl.c | 7 +++++++ xen/include/public/domctl.h | 1 + 2 files changed, 8 insertions(+) diff --git a/xen/arch/x86/domctl.c b/xen/arch/x86/domctl.c index 696eff2..7902af7 100644 --- a/xen/arch/x86/domctl.c +++ b/xen/arch/x86/domctl.c @@ -1496,6 +1496,13 @@ long arch_do_domctl( copyback = true; break; + case XEN_DOMCTL_PSR_ALLOC_GET_MBA_THRTL: + ret = psr_get_val(d, domctl->u.psr_alloc.target, + &val32, PSR_TYPE_MBA_THRTL); + domctl->u.psr_alloc.data = val32; + copyback = true; + break; + default: ret = -EOPNOTSUPP; break; diff --git a/xen/include/public/domctl.h b/xen/include/public/domctl.h index a953157..8be38cc 100644 --- a/xen/include/public/domctl.h +++ b/xen/include/public/domctl.h @@ -1144,6 +1144,7 @@ struct xen_domctl_psr_alloc { #define XEN_DOMCTL_PSR_ALLOC_GET_L3_DATA 5 #define XEN_DOMCTL_PSR_ALLOC_SET_L2_CBM 6 #define XEN_DOMCTL_PSR_ALLOC_GET_L2_CBM 7 +#define XEN_DOMCTL_PSR_ALLOC_GET_MBA_THRTL 9 uint32_t cmd; /* IN: XEN_DOMCTL_PSR_CAT_OP_* */ uint32_t target; /* IN */ uint64_t data; /* IN/OUT */